Postgres


Graph

Architectural Details

The PostgreSQL server can handle multiple concurrent connections from clients. To achieve this it starts (“forks”) a new process for each connection. From that point on, the client and the new server process communicate without intervention by the original postgres process. Thus, the supervisor server process is always running, waiting for client connections, whereas client and associated server processes come and go.

Row Level Security

ALTER TABLE table_name ENABLE ROW LEVEL SECURITY;
CREATE POLICY table_owner_policy
ON table_name
USING (user_id = current_setting('app.user_id')::uuid);

Useful Extensions

pg_stat_statements

  • requires extra shared memory
  • keeps track of user activity on database and tracks the query times as well

timescaledb

  • a full featured timescale database

Tricks

View Current Logfile

SELECT pg_read_file(pg_current_logfile());

Backlinks