Skip to content

Commit 3022cb1

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 2fcf685 commit 3022cb1

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
@@ -72,10 +72,10 @@ DO $stmt$
7272
FROM pg_class
7373
WHERE relname !~ '^pg_'
7474
AND relhasoids
75-
AND relkind in ('r','m')
75+
AND relkind in ('r', 'f')
7676
ORDER BY 1
7777
LOOP
78-
execute 'ALTER TABLE ' || rec || ' SET WITHOUT OIDS';
78+
EXECUTE 'ALTER TABLE ' || quote_ident(rec) || ' SET WITHOUT OIDS';
7979
END LOOP;
8080
END; $stmt$;
8181
\endif

0 commit comments

Comments
 (0)