mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +03:00
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
This commit is contained in:
@@ -33,6 +33,13 @@ typedef struct xl_replorigin_drop
|
||||
#define InvalidRepOriginId 0
|
||||
#define DoNotReplicateId PG_UINT16_MAX
|
||||
|
||||
/*
|
||||
* To avoid needing a TOAST table for pg_replication_origin, we limit
|
||||
* replication origin names to 512 bytes. This should be more than enough for
|
||||
* all practical use.
|
||||
*/
|
||||
#define MAX_RONAME_LEN 512
|
||||
|
||||
extern PGDLLIMPORT RepOriginId replorigin_session_origin;
|
||||
extern PGDLLIMPORT XLogRecPtr replorigin_session_origin_lsn;
|
||||
extern PGDLLIMPORT TimestampTz replorigin_session_origin_timestamp;
|
||||
|
||||
Reference in New Issue
Block a user