Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4ad31bb

Browse files
committed
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
1 parent 9522085 commit 4ad31bb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/backend/replication/logical/tablesync.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ fetch_remote_table_info(char *nspname, char *relname,
640640
StringInfoData cmd;
641641
TupleTableSlot *slot;
642642
Oid tableRow[] = {OIDOID, CHAROID, CHAROID};
643-
Oid attrRow[] = {TEXTOID, OIDOID, INT4OID, BOOLOID};
643+
Oid attrRow[] = {TEXTOID, OIDOID, BOOLOID};
644644
bool isnull;
645645
int natt;
646646

@@ -685,7 +685,6 @@ fetch_remote_table_info(char *nspname, char *relname,
685685
appendStringInfo(&cmd,
686686
"SELECT a.attname,"
687687
" a.atttypid,"
688-
" a.atttypmod,"
689688
" a.attnum = ANY(i.indkey)"
690689
" FROM pg_catalog.pg_attribute a"
691690
" LEFT JOIN pg_catalog.pg_index i"
@@ -718,7 +717,7 @@ fetch_remote_table_info(char *nspname, char *relname,
718717
Assert(!isnull);
719718
lrel->atttyps[natt] = DatumGetObjectId(slot_getattr(slot, 2, &isnull));
720719
Assert(!isnull);
721-
if (DatumGetBool(slot_getattr(slot, 4, &isnull)))
720+
if (DatumGetBool(slot_getattr(slot, 3, &isnull)))
722721
lrel->attkeys = bms_add_member(lrel->attkeys, natt);
723722

724723
/* Should never happen. */

0 commit comments

Comments
 (0)