Remove pg_replication_origin's TOAST table.
authorNathan Bossart <nathan@postgresql.org>
Wed, 7 May 2025 19:47:36 +0000 (14:47 -0500)
committerNathan Bossart <nathan@postgresql.org>
Wed, 7 May 2025 19:47:36 +0000 (14:47 -0500)
commit16bf24e0e471c975f0877d6612eacdae7ce4a30e
tree0ce1620d597b90d28fb6b428693df925a21347c8
parent5f4d98d4f3718cf7a0597c37f3ee4a4485de6ef8
Remove pg_replication_origin's TOAST table.

A few places that access this catalog don't set up an active
snapshot before potentially accessing its TOAST table.  However,
roname (the replication origin name) is the only varlena column, so
this is only a problem if the name requires out-of-line storage.
This commit removes its TOAST table to avoid needing to set up a
snapshot.  It also places a limit on replication origin names so
that attempts to set long names will fail with a more user-friendly
error.  Those chosen limit of 512 bytes should be sufficient to
avoid "row is too big" errors independent of BLCKSZ, but it should
also be lenient enough for all reasonable use-cases.

Bumps catversion.

Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Euler Taveira <euler@eulerto.com>
Reviewed-by: Nisha Moond <nisha.moond412@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/ZvMSUPOqUU-VNADN%40nathan
doc/src/sgml/func.sgml
src/backend/catalog/catalog.c
src/backend/replication/logical/origin.c
src/include/catalog/catversion.h
src/include/catalog/pg_replication_origin.h
src/include/replication/origin.h
src/test/regress/expected/misc_functions.out
src/test/regress/expected/misc_sanity.out
src/test/regress/sql/misc_functions.sql
src/test/regress/sql/misc_sanity.sql