{"schema": "pgtrue.report/1", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1", "published": "2026-10-01T00:12:09Z", "publisher": "PostgresAI", "article": {"title": "Best practices for Amazon RDS PostgreSQL replication | Amazon Web Services", "url": "https://aws.amazon.com/blogs/database/best-practices-for-amazon-rds-postgresql-replication", "date_published": "2019-07-30T15:04:38Z", "author": "Vivek Singh", "publisher": "AWS Database Blog"}, "grade": "D", "axes": [{"axis": "Factual", "summary": "B \u00b7 2 wrong \u00b7 1 caveat \u00b7 14 checked"}, {"axis": "Applicable", "summary": "B+ \u00b7 1 wrong \u00b7 1 caveat \u00b7 8 checked"}, {"axis": "Consistent", "summary": "A \u00b7 0 wrong \u00b7 0 caveats \u00b7 14 checked"}, {"axis": "Transparent", "summary": "A \u00b7 0 wrong \u00b7 0 caveats \u00b7 7 checked"}, {"axis": "Safe", "summary": "D \u00b7 2 wrong \u00b7 1 caveat \u00b7 3 checked"}], "findings": [{"anchor": "F1", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1#F1", "claim": "This query kills read transactions running longer than five minutes:\u2026", "title": "The five-minute query also terminates idle connections", "explanation": "query_start records the last query's start even when a connection is idle. The predicate checks neither activity nor transaction age. pg_terminate_backend sends SIGTERM to selected backends. This can disconnect idle application sessions, not just long-running reads.", "verdict": "Dangerous", "sources": [{"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/doc/src/sgml/monitoring.sgml#L633-L635", "label": "REL9_6_24 \u00b7 doc/src/sgml/monitoring.sgml:633-635"}, {"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/src/backend/utils/adt/misc.c#L307-L309", "label": "REL9_6_24 \u00b7 src/backend/utils/adt/misc.c:307-309"}, {"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/doc/src/sgml/monitoring.sgml#L633-L635", "label": "REL9_6_24 \u00b7 doc/src/sgml/monitoring.sgml:633-635"}, {"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/doc/src/sgml/monitoring.sgml#L624-L627", "label": "REL9_6_24 \u00b7 doc/src/sgml/monitoring.sgml:624-627"}, {"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/src/backend/utils/adt/misc.c#L307-L309", "label": "REL9_6_24 \u00b7 src/backend/utils/adt/misc.c:307-309"}]}, {"anchor": "F2", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1#F2", "claim": "\u2026kill inactive ones\u2026", "title": "Inactive replication slots are not necessarily disposable", "explanation": "active reflects whether a process currently uses the slot. Slots retain required resources across consumer disconnections. Dropping one removes that protection for a consumer that might resume. Confirm that the consumer no longer needs the slot before deleting it.", "verdict": "Dangerous", "sources": [{"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/doc/src/sgml/logicaldecoding.sgml#L253-L258", "label": "REL9_6_24 \u00b7 doc/src/sgml/logicaldecoding.sgml:253-258"}, {"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/src/backend/replication/slotfuncs.c#L272-L272", "label": "REL9_6_24 \u00b7 src/backend/replication/slotfuncs.c:272-272"}]}, {"anchor": "F3", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1#F3", "claim": "\u2026SELECT pg_drop_replication_slot('slot_name') from pg_replication_slots where active = 'f';\u2026", "explanation": "pg_drop_replication_slot receives the constant 'slot_name' for every selected row (slotfuncs.c:158-166, REL9_6_24). It never receives the row's slot_name column. The statement errors on a nonexistent slot instead of bulk-dropping. Use the column, unquoted, and only after confirming the consumer is gone.", "verdict": "Misleading", "sources": [{"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/src/backend/replication/slotfuncs.c#L160-L166", "label": "REL9_6_24 \u00b7 src/backend/replication/slotfuncs.c:160-166"}, {"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/src/backend/replication/slotfuncs.c#L158-L166", "label": "REL9_6_24 \u00b7 src/backend/replication/slotfuncs.c:158-166"}]}, {"anchor": "F5", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1#F5", "claim": "Set this parameter high enough to prevent WAL files from archiving\u2026", "title": "wal_keep_size does not prevent WAL archival", "explanation": "wal_keep_size sets a minimum local retention size. archive_mode sends completed segments to archive storage independently. Increasing retention can keep segments available for streaming. It neither stops archival nor sets a maximum pg_wal directory size.", "verdict": "Misleading", "sources": [{"url": "https://github.com/postgres/postgres/blob/83ed1f71c88ae948a5b6ec6d2a4802cc54470102/doc/src/sgml/config.sgml#L3545-L3548", "label": "REL_15_4 \u00b7 doc/src/sgml/config.sgml:3545-3548"}, {"url": "https://github.com/postgres/postgres/blob/83ed1f71c88ae948a5b6ec6d2a4802cc54470102/doc/src/sgml/config.sgml#L4254-L4256", "label": "REL_15_4 \u00b7 doc/src/sgml/config.sgml:4254-4256"}]}, {"anchor": "F11", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1#F11", "claim": "Set this parameter high enough to prevent WAL files from archiving when streaming replication starts.", "explanation": "wal_keep_size retains local WAL against early recycling. It does not stop completed segments from entering the archive. PostgreSQL 9.6.24 documents archiving completed segments in doc/src/sgml/backup.sgml:594. Size retention to avoid archive recovery, not to suppress archival copies.", "verdict": "Misleading", "sources": [{"url": "https://www.postgresql.org/docs/current/warm-standby.html", "label": "https://www.postgresql.org/docs/current/warm-standby.html"}, {"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/doc/src/sgml/backup.sgml#L594-L597", "label": "REL9_6_24 \u00b7 doc/src/sgml/backup.sgml:594-597"}]}, {"anchor": "F4", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1#F4", "claim": "\u2026postpone VACUUM on related tables\u2026", "title": "hot_standby_feedback delays dead-row removal, not VACUUM itself", "explanation": "walsender.c:1735 sets the cleanup horizon from the standby's xmin. VACUUM can run while that horizon prevents removal of protected dead rows. The article's bloat warning is valid, but its description of postponing VACUUM is not.", "verdict": "Mostly accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/src/backend/replication/walsender.c#L1735-L1738", "label": "REL9_6_24 \u00b7 src/backend/replication/walsender.c:1735-1738"}]}, {"anchor": "F6", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1#F6", "claim": "\u2026DROP TABLE , TRUNCATE , REINDEX , CLUSTER , VACUUM FULL\u2026", "title": "REINDEX does not take ACCESS EXCLUSIVE on the table", "explanation": "ReindexTable takes ShareLock on the table in PostgreSQL 9.6. The article groups it with commands taking ACCESS EXCLUSIVE on tables. Older official documentation uses the same grouping. Distinguish the table lock from locks on its indexes when assessing blocking.", "verdict": "Mostly accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/src/backend/commands/indexcmds.c#L1853-L1859", "label": "REL9_6_24 \u00b7 src/backend/commands/indexcmds.c:1853-1859"}, {"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/doc/src/sgml/mvcc.sgml#L1039-L1043", "label": "REL9_6_24 \u00b7 doc/src/sgml/mvcc.sgml:1039-1043"}]}, {"anchor": "F10", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1#F10", "claim": "You can confirm the data version by looking at the replication lag in Amazon CloudWatch metrics\u2026", "explanation": "RDS computes ReplicaLag from the last committed transaction timestamp and reports up to five minutes when the primary is idle. A high value can appear with no data difference. A low value does show recent commits applied. The article omits the idle-primary caveat.", "verdict": "Mostly accurate", "sources": [{"url": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PostgreSQL.Replication.ReadReplicas.html", "label": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PostgreSQL.Replication.ReadReplicas.html"}]}, {"anchor": "F8", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1#F8", "claim": "\u2026logical replication replicates sequence data in serial or identity columns\u2026", "title": "Logical replication copies generated column values without sequence state", "explanation": "PostgreSQL 15.4 replicates stored values in serial and identity columns. It does not replicate the backing sequence's state. The article correctly warns that promotion requires updating sequences.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/83ed1f71c88ae948a5b6ec6d2a4802cc54470102/doc/src/sgml/logical-replication.sgml#L1375-L1378", "label": "REL_15_4 \u00b7 doc/src/sgml/logical-replication.sgml:1375-1378"}]}, {"anchor": "F9", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1#F9", "claim": "\u2026the following query monitors locks in Postgres 9.6 and newer Postgres instances\u2026", "title": "pg_blocking_pids identifies lock blockers in PostgreSQL 9.6", "explanation": "pg_blocking_pids returns processes blocking the requested PID. It includes conflicting lock holders and earlier conflicting waiters. Filtering nonempty arrays identifies blocked sessions in PostgreSQL 9.6.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/src/backend/utils/adt/lockfuncs.c#L411-L415", "label": "REL9_6_24 \u00b7 src/backend/utils/adt/lockfuncs.c:411-415"}]}, {"anchor": "F12", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1#F12", "claim": "\u2026cross-region replication lag causes WAL accumulation at the source instance\u2026", "title": "Replication-slot retention can exhaust WAL storage", "explanation": "Replication slots can retain enough WAL to fill pg_wal. PostgreSQL\u2019s replication-slot documentation states this risk explicitly. Under the article\u2019s stated retention hypothesis, monitoring source storage is justified.", "verdict": "Accurate", "sources": [{"url": "https://www.postgresql.org/docs/current/warm-standby.html", "label": "https://www.postgresql.org/docs/current/warm-standby.html"}]}, {"anchor": "F13", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1#F13", "claim": "ACCESS EXCLUSIVE is the most restrictive lock mode (conflicts with all other lock modes).", "title": "ACCESS EXCLUSIVE conflicts with every table-lock mode", "explanation": "ACCESS EXCLUSIVE excludes other transactions from accessing the same table. PostgreSQL\u2019s explicit-locking documentation confirms that rule. Ordinary SELECT queries conflict with this lock.", "verdict": "Accurate", "sources": [{"url": "https://www.postgresql.org/docs/current/explicit-locking.html", "label": "https://www.postgresql.org/docs/current/explicit-locking.html"}]}, {"anchor": "F14", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1#F14", "claim": "You can configure Read Replicas within the same Region as the source or in a different Region.", "title": "RDS supports same-region and cross-region read replicas", "explanation": "RDS documents read replicas within the source Region and in another Region. The article correctly identifies both placement options.", "verdict": "Accurate", "sources": [{"url": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html", "label": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html"}]}, {"anchor": "F16", "url": "https://pgtrue.postgres.ai/shared/brief/f03f1c24-e8ce-4d68-a613-d2fa932c25b1#F16", "claim": "\u2026WHERE cardinality(pg_blocking_pids(pid)) > 0;\u2026", "title": "The lock query selects blocked sessions", "explanation": "pg_blocking_pids returns blocker identifiers, or an empty array for an unblocked process. The cardinality predicate selects sessions with at least one blocker. PostgreSQL 9.6 supports this diagnostic.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/doc/src/sgml/func.sgml#L15782-L15800", "label": "REL9_6_24 \u00b7 doc/src/sgml/func.sgml:15782-15800"}]}]}