harden backup system schema filtering

This commit is contained in:
Dotta committed 2026-05-01 10:57:42 -05:00
1 parent 19c71ca39a
commit 8e25be699c
1 file changed
+3 -3
+3 -3
View File
@@ -239,9 +239,9 @@ function tableKey(schemaName: string, tableName: string): string {
}
function nonSystemSchemaPredicate(identifier: string): string {
return `${identifier} NOT IN ('pg_catalog', 'information_schema')
AND ${identifier} NOT LIKE 'pg_toast%'
AND ${identifier} NOT LIKE 'pg_temp_%'`;
// PostgreSQL reserves pg_ prefixes for system schemas, including temp/toast variants.
return `${identifier} <> 'information_schema'
AND ${identifier} NOT LIKE 'pg\\_%' ESCAPE '\\'`;
}
function hasBackupTransforms(opts: RunDatabaseBackupOptions): boolean {