summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorMichael Paquier2022-12-23 02:26:49 +0000
committerMichael Paquier2022-12-23 02:26:49 +0000
commit3022cb14339656be2afeee72150dcc5725838398 (patch)
tree0ebc897631031502b2e498bfbd263fb16cf9b748 /src/bin
parent2fcf685f6daa4f872ca726e25cc504a544916dbb (diff)
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
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/pg_upgrade/upgrade_adapt.sql4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/pg_upgrade/upgrade_adapt.sql b/src/bin/pg_upgrade/upgrade_adapt.sql
index 27c4c7fd011..d0580e42823 100644
--- a/src/bin/pg_upgrade/upgrade_adapt.sql
+++ b/src/bin/pg_upgrade/upgrade_adapt.sql
@@ -72,10 +72,10 @@ DO $stmt$
FROM pg_class
WHERE relname !~ '^pg_'
AND relhasoids
- AND relkind in ('r','m')
+ AND relkind in ('r', 'f')
ORDER BY 1
LOOP
- execute 'ALTER TABLE ' || rec || ' SET WITHOUT OIDS';
+ EXECUTE 'ALTER TABLE ' || quote_ident(rec) || ' SET WITHOUT OIDS';
END LOOP;
END; $stmt$;
\endif