aboutsummaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/worker.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/replication/logical/worker.c')
-rw-r--r--src/backend/replication/logical/worker.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index 571b0e717e1..2f448036ea1 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -89,7 +89,6 @@ static dlist_head lsn_mapping = DLIST_STATIC_INIT(lsn_mapping);
typedef struct SlotErrCallbackArg
{
LogicalRepRelMapEntry *rel;
- int local_attnum;
int remote_attnum;
} SlotErrCallbackArg;
@@ -288,36 +287,23 @@ slot_fill_defaults(LogicalRepRelMapEntry *rel, EState *estate,
}
/*
- * Error callback to give more context info about type conversion failure.
+ * Error callback to give more context info about data conversion failures
+ * while reading data from the remote server.
*/
static void
slot_store_error_callback(void *arg)
{
SlotErrCallbackArg *errarg = (SlotErrCallbackArg *) arg;
LogicalRepRelMapEntry *rel;
- char *remotetypname;
- Oid remotetypoid,
- localtypoid;
/* Nothing to do if remote attribute number is not set */
if (errarg->remote_attnum < 0)
return;
rel = errarg->rel;
- remotetypoid = rel->remoterel.atttyps[errarg->remote_attnum];
-
- /* Fetch remote type name from the LogicalRepTypMap cache */
- remotetypname = logicalrep_typmap_gettypname(remotetypoid);
-
- /* Fetch local type OID from the local sys cache */
- localtypoid = get_atttype(rel->localreloid, errarg->local_attnum + 1);
-
- errcontext("processing remote data for replication target relation \"%s.%s\" column \"%s\", "
- "remote type %s, local type %s",
+ errcontext("processing remote data for replication target relation \"%s.%s\" column \"%s\"",
rel->remoterel.nspname, rel->remoterel.relname,
- rel->remoterel.attnames[errarg->remote_attnum],
- remotetypname,
- format_type_be(localtypoid));
+ rel->remoterel.attnames[errarg->remote_attnum]);
}
/*
@@ -338,7 +324,6 @@ slot_store_cstrings(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
/* Push callback + info on the error context stack */
errarg.rel = rel;
- errarg.local_attnum = -1;
errarg.remote_attnum = -1;
errcallback.callback = slot_store_error_callback;
errcallback.arg = (void *) &errarg;
@@ -357,7 +342,6 @@ slot_store_cstrings(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
Oid typinput;
Oid typioparam;
- errarg.local_attnum = i;
errarg.remote_attnum = remoteattnum;
getTypeInputInfo(att->atttypid, &typinput, &typioparam);
@@ -366,7 +350,6 @@ slot_store_cstrings(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
typioparam, att->atttypmod);
slot->tts_isnull[i] = false;
- errarg.local_attnum = -1;
errarg.remote_attnum = -1;
}
else
@@ -422,7 +405,6 @@ slot_modify_cstrings(TupleTableSlot *slot, TupleTableSlot *srcslot,
/* For error reporting, push callback + info on the error context stack */
errarg.rel = rel;
- errarg.local_attnum = -1;
errarg.remote_attnum = -1;
errcallback.callback = slot_store_error_callback;
errcallback.arg = (void *) &errarg;
@@ -446,7 +428,6 @@ slot_modify_cstrings(TupleTableSlot *slot, TupleTableSlot *srcslot,
Oid typinput;
Oid typioparam;
- errarg.local_attnum = i;
errarg.remote_attnum = remoteattnum;
getTypeInputInfo(att->atttypid, &typinput, &typioparam);
@@ -455,7 +436,6 @@ slot_modify_cstrings(TupleTableSlot *slot, TupleTableSlot *srcslot,
typioparam, att->atttypmod);
slot->tts_isnull[i] = false;
- errarg.local_attnum = -1;
errarg.remote_attnum = -1;
}
else
@@ -579,8 +559,7 @@ apply_handle_relation(StringInfo s)
/*
* Handle TYPE message.
*
- * Note we don't do local mapping here, that's done when the type is
- * actually used.
+ * This is now vestigial; we read the info and discard it.
*/
static void
apply_handle_type(StringInfo s)
@@ -588,7 +567,6 @@ apply_handle_type(StringInfo s)
LogicalRepTyp typ;
logicalrep_read_typ(s, &typ);
- logicalrep_typmap_update(&typ);
}
/*