aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/replication/logical/relation.c2
-rw-r--r--src/backend/replication/pgoutput/pgoutput.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c
index 5aee4b80e66..85269c037de 100644
--- a/src/backend/replication/logical/relation.c
+++ b/src/backend/replication/logical/relation.c
@@ -425,7 +425,7 @@ logicalrep_typmap_gettypname(Oid remoteid)
bool found;
/* Internal types are mapped directly. */
- if (remoteid < FirstNormalObjectId)
+ if (remoteid < FirstGenbkiObjectId)
{
if (!get_typisdefined(remoteid))
{
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index bf64c8e4a42..63687a97ece 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -269,8 +269,12 @@ maybe_send_schema(LogicalDecodingContext *ctx,
desc = RelationGetDescr(relation);
/*
- * Write out type info if needed. We do that only for user created
- * types.
+ * Write out type info if needed. We do that only for user-created
+ * types. We use FirstGenbkiObjectId as the cutoff, so that we only
+ * consider objects with hand-assigned OIDs to be "built in", not for
+ * instance any function or type defined in the information_schema.
+ * This is important because only hand-assigned OIDs can be expected
+ * to remain stable across major versions.
*/
for (i = 0; i < desc->natts; i++)
{
@@ -279,7 +283,7 @@ maybe_send_schema(LogicalDecodingContext *ctx,
if (att->attisdropped || att->attgenerated)
continue;
- if (att->atttypid < FirstNormalObjectId)
+ if (att->atttypid < FirstGenbkiObjectId)
continue;
OutputPluginPrepareWrite(ctx, false);