=== Applying patches on top of PostgreSQL commit ID fe29b2a1dab2b3d81e6c350679b7d9b0e1c8c850 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Fri May 16 04:12:21 UTC 2025 On branch cf/5262 nothing to commit, working tree clean === using 'git am' to apply patch ./v7-0001-Remove-pg_replication_origin-s-TOAST-table.patch === Applying: Remove pg_replication_origin's TOAST table. Using index info to reconstruct a base tree... M doc/src/sgml/func.sgml M src/backend/catalog/catalog.c M src/backend/replication/logical/origin.c M src/include/catalog/pg_replication_origin.h M src/include/replication/origin.h M src/test/regress/expected/misc_functions.out M src/test/regress/expected/misc_sanity.out M src/test/regress/sql/misc_functions.sql M src/test/regress/sql/misc_sanity.sql Falling back to patching base and 3-way merge... Auto-merging src/test/regress/sql/misc_sanity.sql CONFLICT (content): Merge conflict in src/test/regress/sql/misc_sanity.sql Auto-merging src/test/regress/sql/misc_functions.sql CONFLICT (content): Merge conflict in src/test/regress/sql/misc_functions.sql Auto-merging src/test/regress/expected/misc_sanity.out CONFLICT (content): Merge conflict in src/test/regress/expected/misc_sanity.out Auto-merging src/test/regress/expected/misc_functions.out CONFLICT (content): Merge conflict in src/test/regress/expected/misc_functions.out Auto-merging src/include/replication/origin.h CONFLICT (content): Merge conflict in src/include/replication/origin.h Auto-merging src/backend/replication/logical/origin.c CONFLICT (content): Merge conflict in src/backend/replication/logical/origin.c Auto-merging doc/src/sgml/func.sgml error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Remove pg_replication_origin's TOAST table. 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". Unstaged changes after reset: M src/backend/replication/logical/origin.c M src/include/replication/origin.h M src/test/regress/expected/misc_functions.out M src/test/regress/expected/misc_sanity.out M src/test/regress/sql/misc_functions.sql M src/test/regress/sql/misc_sanity.sql === using patch(1) to apply patch ./v7-0001-Remove-pg_replication_origin-s-TOAST-table.patch === patching file doc/src/sgml/func.sgml Hunk #1 FAILED at 29941. 1 out of 1 hunk FAILED -- saving rejects to file doc/src/sgml/func.sgml.rej patching file src/backend/catalog/catalog.c Hunk #1 FAILED at 346. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/catalog/catalog.c.rej patching file src/backend/replication/logical/origin.c Hunk #1 succeeded at 310 with fuzz 2 (offset 23 lines). Hunk #2 succeeded at 1331 (offset 23 lines). patching file src/include/catalog/pg_replication_origin.h Hunk #1 FAILED at 54. 1 out of 1 hunk FAILED -- saving rejects to file src/include/catalog/pg_replication_origin.h.rej patching file src/include/replication/origin.h Hunk #1 succeeded at 40 with fuzz 2 (offset 7 lines). patching file src/test/regress/expected/misc_functions.out Hunk #1 FAILED at 914. 1 out of 1 hunk FAILED -- saving rejects to file src/test/regress/expected/misc_functions.out.rej patching file src/test/regress/expected/misc_sanity.out Hunk #1 FAILED at 42. Hunk #2 FAILED at 61. 2 out of 2 hunks FAILED -- saving rejects to file src/test/regress/expected/misc_sanity.out.rej patching file src/test/regress/sql/misc_functions.sql Hunk #1 FAILED at 411. 1 out of 1 hunk FAILED -- saving rejects to file src/test/regress/sql/misc_functions.sql.rej patching file src/test/regress/sql/misc_sanity.sql Hunk #1 FAILED at 45. 1 out of 1 hunk FAILED -- saving rejects to file src/test/regress/sql/misc_sanity.sql.rej Unstaged changes after reset: M src/backend/replication/logical/origin.c M src/include/replication/origin.h Removing doc/src/sgml/func.sgml.rej Removing src/backend/catalog/catalog.c.rej Removing src/include/catalog/pg_replication_origin.h.rej Removing src/test/regress/expected/misc_functions.out.rej Removing src/test/regress/expected/misc_sanity.out.rej Removing src/test/regress/sql/misc_functions.sql.rej Removing src/test/regress/sql/misc_sanity.sql.rej === using 'git apply' to apply patch ./v7-0001-Remove-pg_replication_origin-s-TOAST-table.patch === Applied patch to 'doc/src/sgml/func.sgml' cleanly. Applied patch to 'src/backend/catalog/catalog.c' cleanly. Applied patch to 'src/backend/replication/logical/origin.c' with conflicts. Applied patch to 'src/include/catalog/pg_replication_origin.h' cleanly. Applied patch to 'src/include/replication/origin.h' with conflicts. Applied patch to 'src/test/regress/expected/misc_functions.out' with conflicts. Applied patch to 'src/test/regress/expected/misc_sanity.out' with conflicts. Applied patch to 'src/test/regress/sql/misc_functions.sql' with conflicts. Applied patch to 'src/test/regress/sql/misc_sanity.sql' with conflicts. U src/backend/replication/logical/origin.c U src/include/replication/origin.h U src/test/regress/expected/misc_functions.out U src/test/regress/expected/misc_sanity.out U src/test/regress/sql/misc_functions.sql U src/test/regress/sql/misc_sanity.sql diff --cc src/backend/replication/logical/origin.c index a17bacf88e7,9e5a09e63e1..00000000000 --- a/src/backend/replication/logical/origin.c +++ b/src/backend/replication/logical/origin.c @@@ -303,10 -291,11 +303,18 @@@ replorigin_create(const char *roname * We want to be able to access pg_replication_origin without setting up a * snapshot. To make that safe, it needs to not have a TOAST table, since * TOASTed data cannot be fetched without a snapshot. As of this writing, ++<<<<<<< ours + * its only varlena column is roname, which we limit to 512 bytes to avoid + * needing out-of-line storage. If you add a TOAST table to this catalog, + * be sure to set up a snapshot everywhere it might be needed. For more + * information, see https://postgr.es/m/ZvMSUPOqUU-VNADN%40nathan. ++======= + * its TOAST table would only be used for replication origin names, which + * we avoid with a reasonable length restriction. If you add a TOAST + * table to this catalog, be sure to set up a snapshot everywhere it might + * be needed. For more information, see + * https://postgr.es/m/ZvMSUPOqUU-VNADN%40nathan. ++>>>>>>> theirs */ Assert(!OidIsValid(rel->rd_rel->reltoastrelid)); diff --cc src/include/replication/origin.h index 2a73f6aa492,29724c0dcae..00000000000 --- a/src/include/replication/origin.h +++ b/src/include/replication/origin.h @@@ -34,7 -34,7 +34,11 @@@ typedef struct xl_replorigin_dro #define DoNotReplicateId PG_UINT16_MAX /* ++<<<<<<< ours + * To avoid needing a TOAST table for pg_replication_origin, we limit ++======= + * To avoid needing a TOAST table for pg_replication_origin, we restrict ++>>>>>>> theirs * replication origin names to 512 bytes. This should be more than enough for * all practical use. */ diff --cc src/test/regress/expected/misc_functions.out index cc517ed5e90,3de32c3c7ef..00000000000 --- a/src/test/regress/expected/misc_functions.out +++ b/src/test/regress/expected/misc_functions.out @@@ -914,7 -914,7 +914,11 @@@ SELECT test_relpath() (1 row) ++<<<<<<< ours +-- pg_replication_origin.roname limit ++======= + -- pg_replication_origin.roname length restriction ++>>>>>>> theirs SELECT pg_replication_origin_create('regress_' || repeat('a', 505)); ERROR: replication origin name is too long DETAIL: Replication origin names must be no longer than 512 bytes. diff --cc src/test/regress/expected/misc_sanity.out index 4ffc45a8018,21297fc6164..00000000000 --- a/src/test/regress/expected/misc_sanity.out +++ b/src/test/regress/expected/misc_sanity.out @@@ -45,8 -45,8 +45,13 @@@ WHERE refclassid = 0 OR refobjid = 0 O -- 4. pg_replication_origin, since we want to be able to access that catalog -- without setting up a snapshot. To make that safe, it needs to not have a -- toast table, since toasted data cannot be fetched without a snapshot. As of ++<<<<<<< ours +-- this writing, its only varlena column is roname, which we limit to 512 bytes +-- to avoid needing out-of-line storage. ++======= + -- this writing, its toast table would only be used for replication origin + -- names, which we can avoid with a reasonable length restriction. ++>>>>>>> theirs SELECT relname, attname, atttypid::regtype FROM pg_class c JOIN pg_attribute a ON c.oid = attrelid WHERE c.oid < 16384 AND diff --cc src/test/regress/sql/misc_functions.sql index 5f9c77512d1,ea72a62dab7..00000000000 --- a/src/test/regress/sql/misc_functions.sql +++ b/src/test/regress/sql/misc_functions.sql @@@ -412,5 -412,5 +412,9 @@@ CREATE FUNCTION test_relpath( LANGUAGE C; SELECT test_relpath(); ++<<<<<<< ours +-- pg_replication_origin.roname limit ++======= + -- pg_replication_origin.roname length restriction ++>>>>>>> theirs SELECT pg_replication_origin_create('regress_' || repeat('a', 505)); diff --cc src/test/regress/sql/misc_sanity.sql index e861614ea71,8ff898843e9..00000000000 --- a/src/test/regress/sql/misc_sanity.sql +++ b/src/test/regress/sql/misc_sanity.sql @@@ -48,8 -48,8 +48,13 @@@ WHERE refclassid = 0 OR refobjid = 0 O -- 4. pg_replication_origin, since we want to be able to access that catalog -- without setting up a snapshot. To make that safe, it needs to not have a -- toast table, since toasted data cannot be fetched without a snapshot. As of ++<<<<<<< ours +-- this writing, its only varlena column is roname, which we limit to 512 bytes +-- to avoid needing out-of-line storage. ++======= + -- this writing, its toast table would only be used for replication origin + -- names, which we can avoid with a reasonable length restriction. ++>>>>>>> theirs SELECT relname, attname, atttypid::regtype FROM pg_class c JOIN pg_attribute a ON c.oid = attrelid