=== Applying patches on top of PostgreSQL commit ID 5310fac6e0fcb1c7fcefb3446767673f9107328c === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Fri Nov 7 00:24:23 UTC 2025 On branch cf/5985 nothing to commit, working tree clean === using 'git am' to apply patch ./v7-0001-Don-t-try-to-re-order-the-subcommands-of-CREATE-SCHEMA.patch === Applying: Don't try to re-order the subcommands of CREATE SCHEMA === using 'git am' to apply patch ./v7-0002-CREATE-SCHEMA-CREATE-DOMAIN.patch === Applying: CREATE SCHEMA CREATE DOMAIN === using 'git am' to apply patch ./v7-0003-CREATE-SCHEMA-CREATE-COLLATION.patch === Applying: CREATE SCHEMA CREATE COLLATION error: sha1 information is lacking or useless (src/backend/parser/gram.y). error: could not build fake ancestor hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 CREATE SCHEMA CREATE COLLATION When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". === using patch(1) to apply patch ./v7-0003-CREATE-SCHEMA-CREATE-COLLATION.patch === patching file doc/src/sgml/ref/create_schema.sgml patching file src/backend/catalog/objectaddress.c Hunk #1 succeeded at 2621 (offset -1 lines). patching file src/backend/parser/gram.y Hunk #1 succeeded at 1635 (offset 8 lines). patching file src/backend/parser/parse_utilcmd.c Hunk #2 succeeded at 4171 (offset -1 lines). patching file src/bin/psql/tab-complete.in.c Hunk #1 succeeded at 2200 (offset 22 lines). Hunk #2 succeeded at 3404 (offset 34 lines). patching file src/include/catalog/objectaddress.h patching file src/test/modules/test_ddl_deparse/expected/create_schema.out patching file src/test/modules/test_ddl_deparse/sql/create_schema.sql patching file src/test/regress/expected/collate.icu.utf8.out Hunk #1 FAILED at 2690. 1 out of 1 hunk FAILED -- saving rejects to file src/test/regress/expected/collate.icu.utf8.out.rej patching file src/test/regress/expected/create_schema.out patching file src/test/regress/sql/collate.icu.utf8.sql Hunk #1 succeeded at 513 with fuzz 2 (offset -484 lines). patching file src/test/regress/sql/create_schema.sql Unstaged changes after reset: M doc/src/sgml/ref/create_schema.sgml M src/backend/catalog/objectaddress.c M src/backend/parser/gram.y M src/backend/parser/parse_utilcmd.c M src/bin/psql/tab-complete.in.c M src/include/catalog/objectaddress.h M src/test/modules/test_ddl_deparse/expected/create_schema.out M src/test/modules/test_ddl_deparse/sql/create_schema.sql M src/test/regress/expected/create_schema.out M src/test/regress/sql/collate.icu.utf8.sql M src/test/regress/sql/create_schema.sql Removing src/test/regress/expected/collate.icu.utf8.out.rej === using 'git apply' to apply patch ./v7-0003-CREATE-SCHEMA-CREATE-COLLATION.patch === Applied patch to 'doc/src/sgml/ref/create_schema.sgml' cleanly. Applied patch to 'src/backend/catalog/objectaddress.c' cleanly. error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... Applied patch to 'src/include/catalog/objectaddress.h' cleanly. Applied patch to 'src/test/modules/test_ddl_deparse/expected/create_schema.out' cleanly. Applied patch to 'src/test/modules/test_ddl_deparse/sql/create_schema.sql' cleanly. Applied patch to 'src/test/regress/expected/collate.icu.utf8.out' with conflicts. Applied patch to 'src/test/regress/expected/create_schema.out' cleanly. Applied patch to 'src/test/regress/sql/collate.icu.utf8.sql' with conflicts. Applied patch to 'src/test/regress/sql/create_schema.sql' cleanly. U src/test/regress/expected/collate.icu.utf8.out U src/test/regress/sql/collate.icu.utf8.sql diff --cc src/test/regress/expected/collate.icu.utf8.out index b8579a1efc6,4c303385447..00000000000 --- a/src/test/regress/expected/collate.icu.utf8.out +++ b/src/test/regress/expected/collate.icu.utf8.out @@@ -2694,55 -2690,28 +2694,80 @@@ SELECT * FROM t5 ORDER BY c ASC, a ASC 3 | d1 | d1 (3 rows) ++<<<<<<< ours +-- Check that DEFAULT expressions in SQL/JSON functions use the same collation +-- as the RETURNING type. Mismatched collations should raise an error. +CREATE DOMAIN d1 AS text COLLATE case_insensitive; +CREATE DOMAIN d2 AS text COLLATE "C"; +SELECT JSON_VALUE('{"a": "A"}', '$.a' RETURNING d1 DEFAULT ('C' COLLATE "C") COLLATE case_insensitive ON EMPTY) = 'a'; -- true + ?column? +---------- + t +(1 row) + +SELECT JSON_VALUE('{"a": "A"}', '$.a' RETURNING d1 DEFAULT 'C' ON EMPTY) = 'a'; -- true + ?column? +---------- + t +(1 row) + +SELECT JSON_VALUE('{"a": "A"}', '$.a' RETURNING d1 DEFAULT 'C'::d2 ON EMPTY) = 'a'; -- error +ERROR: collation of DEFAULT expression conflicts with RETURNING clause +LINE 1: ...ON_VALUE('{"a": "A"}', '$.a' RETURNING d1 DEFAULT 'C'::d2 ON... + ^ +DETAIL: "C" versus "case_insensitive" +SELECT JSON_VALUE('{"a": "A"}', '$.a' RETURNING d1 DEFAULT 'C' COLLATE "C" ON EMPTY) = 'a'; -- error +ERROR: collation of DEFAULT expression conflicts with RETURNING clause +LINE 1: ...ON_VALUE('{"a": "A"}', '$.a' RETURNING d1 DEFAULT 'C' COLLAT... + ^ +DETAIL: "C" versus "case_insensitive" +SELECT JSON_VALUE('{"a": "A"}', '$.c' RETURNING d1 DEFAULT 'A' ON EMPTY) = 'a'; -- true + ?column? +---------- + t +(1 row) + +SELECT JSON_VALUE('{"a": "A"}', '$.c' RETURNING d1 DEFAULT 'A' COLLATE case_insensitive ON EMPTY) = 'a'; -- true + ?column? +---------- + t +(1 row) + +SELECT JSON_VALUE('{"a": "A"}', '$.c' RETURNING d1 DEFAULT 'A'::d2 ON EMPTY) = 'a'; -- error +ERROR: collation of DEFAULT expression conflicts with RETURNING clause +LINE 1: ...ON_VALUE('{"a": "A"}', '$.c' RETURNING d1 DEFAULT 'A'::d2 ON... + ^ +DETAIL: "C" versus "case_insensitive" +SELECT JSON_VALUE('{"a": "A"}', '$.c' RETURNING d1 DEFAULT 'A' COLLATE "C" ON EMPTY) = 'a'; -- error +ERROR: collation of DEFAULT expression conflicts with RETURNING clause +LINE 1: ...ON_VALUE('{"a": "A"}', '$.c' RETURNING d1 DEFAULT 'A' COLLAT... + ^ +DETAIL: "C" versus "case_insensitive" +DROP DOMAIN d1, d2; ++======= + --CREATE SCHEMA CREATE COLLATION + --fail. Execute subcommands in order; we do not implicitly reorder them. + CREATE SCHEMA regress_schema_4 AUTHORIZATION CURRENT_ROLE + CREATE TABLE tts(a TEXT COLLATE coll_icu_und) + CREATE COLLATION coll_icu_und FROM "und-x-icu"; + ERROR: collation "coll_icu_und" for encoding "UTF8" does not exist + LINE 2: CREATE TABLE tts(a TEXT COLLATE coll_icu_und) + ^ + CREATE SCHEMA regress_schema_4 + CREATE COLLATION coll_icu_und FROM "und-x-icu" + CREATE TABLE tts(a TEXT COLLATE coll_icu_und); + \dO regress_schema_4.* + List of collations + Schema | Name | Provider | Collate | Ctype | Locale | ICU Rules | Deterministic? + ------------------+--------------+----------+---------+-------+--------+-----------+---------------- + regress_schema_4 | coll_icu_und | icu | | | und | | yes + (1 row) + + DROP SCHEMA regress_schema_4 CASCADE; + NOTICE: drop cascades to 2 other objects + DETAIL: drop cascades to collation regress_schema_4.coll_icu_und + drop cascades to table regress_schema_4.tts ++>>>>>>> theirs -- cleanup RESET search_path; SET client_min_messages TO warning; diff --cc src/test/regress/sql/collate.icu.utf8.sql index 6f5abac0dc0,06a46662f7f..00000000000 --- a/src/test/regress/sql/collate.icu.utf8.sql +++ b/src/test/regress/sql/collate.icu.utf8.sql @@@ -997,19 -997,18 +997,34 @@@ INSERT INTO t5 (a, b) values (1, 'D1') -- rewriting.) SELECT * FROM t5 ORDER BY c ASC, a ASC; ++<<<<<<< ours +-- Check that DEFAULT expressions in SQL/JSON functions use the same collation +-- as the RETURNING type. Mismatched collations should raise an error. +CREATE DOMAIN d1 AS text COLLATE case_insensitive; +CREATE DOMAIN d2 AS text COLLATE "C"; +SELECT JSON_VALUE('{"a": "A"}', '$.a' RETURNING d1 DEFAULT ('C' COLLATE "C") COLLATE case_insensitive ON EMPTY) = 'a'; -- true +SELECT JSON_VALUE('{"a": "A"}', '$.a' RETURNING d1 DEFAULT 'C' ON EMPTY) = 'a'; -- true +SELECT JSON_VALUE('{"a": "A"}', '$.a' RETURNING d1 DEFAULT 'C'::d2 ON EMPTY) = 'a'; -- error +SELECT JSON_VALUE('{"a": "A"}', '$.a' RETURNING d1 DEFAULT 'C' COLLATE "C" ON EMPTY) = 'a'; -- error +SELECT JSON_VALUE('{"a": "A"}', '$.c' RETURNING d1 DEFAULT 'A' ON EMPTY) = 'a'; -- true +SELECT JSON_VALUE('{"a": "A"}', '$.c' RETURNING d1 DEFAULT 'A' COLLATE case_insensitive ON EMPTY) = 'a'; -- true +SELECT JSON_VALUE('{"a": "A"}', '$.c' RETURNING d1 DEFAULT 'A'::d2 ON EMPTY) = 'a'; -- error +SELECT JSON_VALUE('{"a": "A"}', '$.c' RETURNING d1 DEFAULT 'A' COLLATE "C" ON EMPTY) = 'a'; -- error +DROP DOMAIN d1, d2; ++======= + --CREATE SCHEMA CREATE COLLATION + --fail. Execute subcommands in order; we do not implicitly reorder them. + CREATE SCHEMA regress_schema_4 AUTHORIZATION CURRENT_ROLE + CREATE TABLE tts(a TEXT COLLATE coll_icu_und) + CREATE COLLATION coll_icu_und FROM "und-x-icu"; + + CREATE SCHEMA regress_schema_4 + CREATE COLLATION coll_icu_und FROM "und-x-icu" + CREATE TABLE tts(a TEXT COLLATE coll_icu_und); + \dO regress_schema_4.* + DROP SCHEMA regress_schema_4 CASCADE; + ++>>>>>>> theirs -- cleanup RESET search_path;