Skip to content

Commit 791a9d0

Browse files
authored
PLT-1119 Select tables with relpages (#248)
## 🎫 Ticket https://jira.cms.gov/browse/PLT-1119 ## 🛠 Changes Updated the warmrels table select to not include tables without relpages. ## ℹ️ Context Tables without relpages should not need to be prewarmed, and this avoids including the warmrels table itself in the list, which was resutling in `ERROR: cannot access temporary tables of other sessions`. ## 🧪 Validation Tested on ab2d dev database.
1 parent 5b2ca75 commit 791a9d0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

scripts/prewarm.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ CREATE TEMP TABLE warmrels AS
2525
JOIN pg_user u ON u.usesysid = c.relowner
2626
WHERE u.usename NOT IN ('rdsadmin', 'rdsrepladmin', ' pg_signal_backend', 'rds_superuser', 'rds_replication')
2727
AND c.relkind NOT IN ('v', 'I', 'p')
28+
AND c.relpages > 0
2829
ORDER BY c.relpages ASC;
2930
SELECT * FROM warmrels;
3031

0 commit comments

Comments
 (0)