Skip to content

Commit a2688c4

Browse files
committed
Fix some incorrectness in upgrade_adapt.sql on query for WITH OIDS
The query used to disable WITH OIDS in all the relations making use of it was checking for materialized views, but this is not a supported operation. On the contrary, this needs to be done on foreign tables. While on it, use quote_ident() in the ALTER TABLE strings built on the relation name. Author: Anton A. Melnikov, Michael Paquier Discussion: https://postgr.es/m/49f389ba-95ce-8a9b-09ae-f60650c0e7c7@inbox.ru Backpatch-through: 12
1 parent 7445869 commit a2688c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/pg_upgrade/upgrade_adapt.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ DO $stmt$
7171
FROM pg_class
7272
WHERE relname !~ '^pg_'
7373
AND relhasoids
74-
AND relkind in ('r','m')
74+
AND relkind in ('r', 'f')
7575
ORDER BY 1
7676
LOOP
77-
execute 'ALTER TABLE ' || rec || ' SET WITHOUT OIDS';
77+
EXECUTE 'ALTER TABLE ' || quote_ident(rec) || ' SET WITHOUT OIDS';
7878
END LOOP;
7979
END; $stmt$;
8080
\endif

0 commit comments

Comments
 (0)