summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAlvaro Herrera2024-03-28 15:51:20 +0000
committerAlvaro Herrera2024-03-28 15:51:20 +0000
commite2395cdbe83adc50ac03dd17474ee88c5a97359a (patch)
treefac57f68f483ae308a03a7127693dca45d6c26ba /src/test
parentbe98a550cc81994959f19a117cb2732762df924c (diff)
ALTER TABLE: rework determination of access method ID
Avoid setting an access method OID for relation kinds that don't take one. Code review for new feature added in 374c7a229042. Author: Justin Pryzby <pryzby@telsasoft.com> Reported-by: Alexander Lakhin <exclusion@gmail.com> Discussion: https://postgr.es/m/e5516ac1-5264-c3c0-d822-9e6f614ea93b@gmail.com
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/create_am.out3
-rw-r--r--src/test/regress/sql/create_am.sql3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/test/regress/expected/create_am.out b/src/test/regress/expected/create_am.out
index a27805a8f5e..aa4cb4fa77f 100644
--- a/src/test/regress/expected/create_am.out
+++ b/src/test/regress/expected/create_am.out
@@ -547,6 +547,9 @@ CREATE TABLE i_am_a_failure() USING "I do not exist AM";
ERROR: access method "I do not exist AM" does not exist
CREATE TABLE i_am_a_failure() USING "btree";
ERROR: access method "btree" is not of type TABLE
+-- Other weird invalid cases that cause problems
+CREATE FOREIGN TABLE fp PARTITION OF pg_am DEFAULT SERVER x;
+ERROR: "pg_am" is not partitioned
-- Drop table access method, which fails as objects depends on it
DROP ACCESS METHOD heap2;
ERROR: cannot drop access method heap2 because other objects depend on it
diff --git a/src/test/regress/sql/create_am.sql b/src/test/regress/sql/create_am.sql
index adff0079f98..c57a87da4b9 100644
--- a/src/test/regress/sql/create_am.sql
+++ b/src/test/regress/sql/create_am.sql
@@ -348,6 +348,9 @@ CREATE TABLE i_am_a_failure() USING i_do_not_exist_am;
CREATE TABLE i_am_a_failure() USING "I do not exist AM";
CREATE TABLE i_am_a_failure() USING "btree";
+-- Other weird invalid cases that cause problems
+CREATE FOREIGN TABLE fp PARTITION OF pg_am DEFAULT SERVER x;
+
-- Drop table access method, which fails as objects depends on it
DROP ACCESS METHOD heap2;