aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2022-12-23 11:27:17 +0900
committerMichael Paquier <michael@paquier.xyz>2022-12-23 11:27:17 +0900
commitd4fea2e89d44a0132e86a1659cf79e8c3057bb57 (patch)
treee4c230c01f0c8a8cb46e3e06b52e6d41424c5227 /src
parent4dbe72d61ac6dc1ed4a230db2adec1dc01041f7f (diff)
downloadpostgresql-d4fea2e89d44a0132e86a1659cf79e8c3057bb57.tar.gz
postgresql-d4fea2e89d44a0132e86a1659cf79e8c3057bb57.zip
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')
-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 744b4dc9d87..37a4aad2f33 100644
--- a/src/bin/pg_upgrade/upgrade_adapt.sql
+++ b/src/bin/pg_upgrade/upgrade_adapt.sql
@@ -71,10 +71,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