mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-26 07:39:58 +00:00
This makes sure we don't confuse user-controlled functions with PG's builtin functions. ## Problem See https://github.com/neondatabase/cloud/issues/31628
6 lines
246 B
SQL
6 lines
246 B
SQL
SELECT
|
|
CASE
|
|
WHEN pg_catalog.pg_last_wal_receive_lsn() = pg_catalog.pg_last_wal_replay_lsn() THEN 0
|
|
ELSE GREATEST(0, EXTRACT (EPOCH FROM pg_catalog.now() - pg_catalog.pg_last_xact_replay_timestamp()))
|
|
END AS replication_delay_seconds;
|