03 Jun 2022

PostgreSQL Features

Trigger

A user defined function that fires automatically when an event (insert, update, delete, truncate) occurs.

Transaction

A single unit of work that consists of one or more operations.

→ Ensures operations are completed, otherwise transaction is aborted

BEGIN TRANSACTION; / or BEGIN;
CREATE TABLE test(n int)
INSERT INTO test values(1)
END TRANSACTION; / or COMMIT;

ROLLBACK - a command that reverts changes, run before COMMIT

Streaming Replication

Allows information on the primary server to be transferred to the standby server in real time.