Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit32ebb35

Browse files
committed
Fix logical replication's ideas about which type OIDs are built-in.
Only hand-assigned type OIDs should be presumed to match across differentPG servers; those assigned during genbki.pl or during initdb are likelyto change due to addition or removal of unrelated objects.This means that the cutoff should be FirstGenbkiObjectId (in HEAD)or FirstBootstrapObjectId (before that), not FirstNormalObjectId.Compare postgres_fdw's is_builtin() test.It's likely that this error has no observable consequence in anormally-functioning system, since ATM the only affected type OIDs aresystem catalog rowtypes and information_schema types, which would nottypically be interesting for logical replication. But you couldprobably break it if you tried hard, so back-patch.Discussion:https://postgr.es/m/15150.1557257111@sss.pgh.pa.us
1 parente34ee99 commit32ebb35

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

‎src/backend/replication/logical/relation.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ logicalrep_typmap_gettypname(Oid remoteid)
425425
boolfound;
426426

427427
/* Internal types are mapped directly. */
428-
if (remoteid<FirstNormalObjectId)
428+
if (remoteid<FirstGenbkiObjectId)
429429
{
430430
if (!get_typisdefined(remoteid))
431431
{

‎src/backend/replication/pgoutput/pgoutput.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,12 @@ maybe_send_schema(LogicalDecodingContext *ctx,
269269
desc=RelationGetDescr(relation);
270270

271271
/*
272-
* Write out type info if needed. We do that only for user created
273-
* types.
272+
* Write out type info if needed. We do that only for user-created
273+
* types. We use FirstGenbkiObjectId as the cutoff, so that we only
274+
* consider objects with hand-assigned OIDs to be "built in", not for
275+
* instance any function or type defined in the information_schema.
276+
* This is important because only hand-assigned OIDs can be expected
277+
* to remain stable across major versions.
274278
*/
275279
for (i=0;i<desc->natts;i++)
276280
{
@@ -279,7 +283,7 @@ maybe_send_schema(LogicalDecodingContext *ctx,
279283
if (att->attisdropped||att->attgenerated)
280284
continue;
281285

282-
if (att->atttypid<FirstNormalObjectId)
286+
if (att->atttypid<FirstGenbkiObjectId)
283287
continue;
284288

285289
OutputPluginPrepareWrite(ctx, false);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp