Remove unused column atttypmod from initial tablesync query

The initial tablesync done by logical replication used a query to fetch
the information of a relation's columns that included atttypmod, but it
was left unused.  This was added by 7c4f524.

Author: Euler Taveira
Reviewed-by: Önder Kalacı, Amit Langote, Japin Li
Discussion: https://postgr.es/m/CAHE3wggb715X+mK_DitLXF25B=jE6xyNCH4YOwM860JR7HarGQ@mail.gmail.com
This commit is contained in:
Michael Paquier 2021-02-02 13:59:23 +09:00
parent 9522085ac9
commit 4ad31bb2ef

View File

@ -640,7 +640,7 @@ fetch_remote_table_info(char *nspname, char *relname,
StringInfoData cmd; StringInfoData cmd;
TupleTableSlot *slot; TupleTableSlot *slot;
Oid tableRow[] = {OIDOID, CHAROID, CHAROID}; Oid tableRow[] = {OIDOID, CHAROID, CHAROID};
Oid attrRow[] = {TEXTOID, OIDOID, INT4OID, BOOLOID}; Oid attrRow[] = {TEXTOID, OIDOID, BOOLOID};
bool isnull; bool isnull;
int natt; int natt;
@ -685,7 +685,6 @@ fetch_remote_table_info(char *nspname, char *relname,
appendStringInfo(&cmd, appendStringInfo(&cmd,
"SELECT a.attname," "SELECT a.attname,"
" a.atttypid," " a.atttypid,"
" a.atttypmod,"
" a.attnum = ANY(i.indkey)" " a.attnum = ANY(i.indkey)"
" FROM pg_catalog.pg_attribute a" " FROM pg_catalog.pg_attribute a"
" LEFT JOIN pg_catalog.pg_index i" " LEFT JOIN pg_catalog.pg_index i"
@ -718,7 +717,7 @@ fetch_remote_table_info(char *nspname, char *relname,
Assert(!isnull); Assert(!isnull);
lrel->atttyps[natt] = DatumGetObjectId(slot_getattr(slot, 2, &isnull)); lrel->atttyps[natt] = DatumGetObjectId(slot_getattr(slot, 2, &isnull));
Assert(!isnull); Assert(!isnull);
if (DatumGetBool(slot_getattr(slot, 4, &isnull))) if (DatumGetBool(slot_getattr(slot, 3, &isnull)))
lrel->attkeys = bms_add_member(lrel->attkeys, natt); lrel->attkeys = bms_add_member(lrel->attkeys, natt);
/* Should never happen. */ /* Should never happen. */