thg

PostgreSQL Watch out timestamp or now() function returns timestamp with timezone offset not compatible with pl/pgsql timestamp data type

Run the two commands below and you will see what I mean: select now() AT TIME ZONE current_setting(‘timezone’); 2023-09-30 09:07:31.251 select now(); 2023-09-30 09:17:51.338 -0400 select current_timestamp; select current_timestamp AT TIME ZONE current_setting(‘timezone’); select localtimestamp; So if you have a pl/pgsql procedure that accepts a TIMESTAMP data type, you can’t pass in just “now()” as …

PostgreSQL Watch out timestamp or now() function returns timestamp with timezone offset not compatible with pl/pgsql timestamp data type Read More »

The Most Important PostgreSQL Monitoring Views

Here is the entire list for native on-prem PostgreSQL: https://www.postgresql.org/docs/current/monitoring.html And here are my favorites from that list. PG_STAT_ACTIVITY – shows background activity for a running connection – not service by a connection pooler https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW PG_STAT_REPLICATION – the publication side view shows status of a publications subscribers – lag to them – must be queried …

The Most Important PostgreSQL Monitoring Views Read More »

PostgreSQL optimization – the best of YouTube series

The Best of Series momjian.us/presentations The presentation above addresses requirements open source (mostly free solutions) for PostgreSQL functionality to: – High Availability – No application reconfigure after fail-over/switch – RepMgr (an open source tool for managing PostgreSQL replication and failover) – RPO (recovery point objective / maximum amount of committed data lost) = 0 after …

PostgreSQL optimization – the best of YouTube series Read More »