From 3174f6c90377034faa38077a9965dda2e3f4f0c6 Mon Sep 17 00:00:00 2001 From: naisila Date: Tue, 19 Nov 2024 17:05:18 +0300 Subject: [PATCH] pgmerge pg15 --- src/test/regress/bin/normalize.sed | 9 +++++++++ src/test/regress/expected/pg15.out | 4 ++-- src/test/regress/expected/pgmerge.out | 8 ++++---- src/test/regress/sql/pgmerge.sql | 4 ++-- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/test/regress/bin/normalize.sed b/src/test/regress/bin/normalize.sed index 62e9de697..d2d6d630d 100644 --- a/src/test/regress/bin/normalize.sed +++ b/src/test/regress/bin/normalize.sed @@ -309,3 +309,12 @@ s/permission denied to terminate process/must be a superuser to terminate superu s/permission denied to cancel query/must be a superuser to cancel superuser query/g #endif /* PG_VERSION_NUM < PG_VERSION_16 */ + +# pg17 changes +# can be removed when dropping PG14&15&16 support +#if PG_VERSION_NUM < PG_VERSION_17 +# (This is not preprocessor directive, but a reminder for the developer that will drop PG14&15&16 support ) + +s/(WITH|COPY) (.*) a RETURNING clause/MERGE not supported in \1 query without a RETURNING clause/g + +#endif /* PG_VERSION_NUM < PG_VERSION_17 */ diff --git a/src/test/regress/expected/pg15.out b/src/test/regress/expected/pg15.out index c06142671..e485858a1 100644 --- a/src/test/regress/expected/pg15.out +++ b/src/test/regress/expected/pg15.out @@ -441,12 +441,12 @@ WITH foo AS ( MERGE INTO tbl1 USING tbl2 ON (true) WHEN MATCHED THEN DELETE ) SELECT * FROM foo; -ERROR: MERGE not supported in WITH query +ERROR: MERGE not supported in WITH query without a RETURNING clause COPY ( MERGE INTO tbl1 USING tbl2 ON (true) WHEN MATCHED THEN DELETE ) TO stdout; -ERROR: MERGE not supported in COPY +ERROR: MERGE not supported in COPY query without a RETURNING clause MERGE INTO tbl1 t USING tbl2 ON (true) diff --git a/src/test/regress/expected/pgmerge.out b/src/test/regress/expected/pgmerge.out index a0f5d0c86..381af4965 100644 --- a/src/test/regress/expected/pgmerge.out +++ b/src/test/regress/expected/pgmerge.out @@ -162,18 +162,18 @@ ON tid = tid WHEN MATCHED THEN DO NOTHING; ERROR: name "target" specified more than once DETAIL: The name is used both as MERGE target table and data source. --- used in a CTE +-- used in a CTE without RETURNING WITH foo AS ( MERGE INTO target USING source ON (true) WHEN MATCHED THEN DELETE ) SELECT * FROM foo; -ERROR: MERGE not supported in WITH query --- used in COPY +ERROR: MERGE not supported in WITH query without a RETURNING clause +-- used in COPY without RETURNING COPY ( MERGE INTO target USING source ON (true) WHEN MATCHED THEN DELETE ) TO stdout; -ERROR: MERGE not supported in COPY +ERROR: MERGE not supported in COPY query without a RETURNING clause -- unsupported relation types -- view CREATE VIEW tv AS SELECT * FROM target; diff --git a/src/test/regress/sql/pgmerge.sql b/src/test/regress/sql/pgmerge.sql index e1f3c7aab..f55a710c6 100644 --- a/src/test/regress/sql/pgmerge.sql +++ b/src/test/regress/sql/pgmerge.sql @@ -116,12 +116,12 @@ MERGE INTO target USING target ON tid = tid WHEN MATCHED THEN DO NOTHING; --- used in a CTE +-- used in a CTE without RETURNING WITH foo AS ( MERGE INTO target USING source ON (true) WHEN MATCHED THEN DELETE ) SELECT * FROM foo; --- used in COPY +-- used in COPY without RETURNING COPY ( MERGE INTO target USING source ON (true) WHEN MATCHED THEN DELETE