Skip to content

Commit 61ecc90

Browse files
committed
Fix query that gets remote relation info
Publisher relation can be incorrectly chosen, if there are more than one relation in different schemas with the same name. Author: Euler Taveira <euler@timbira.com.br>
1 parent e495c16 commit 61ecc90

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/replication/logical/tablesync.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,9 @@ fetch_remote_table_info(char *nspname, char *relname,
560560
/* First fetch Oid and replica identity. */
561561
initStringInfo(&cmd);
562562
appendStringInfo(&cmd, "SELECT c.oid, c.relreplident"
563-
" FROM pg_catalog.pg_class c,"
564-
" pg_catalog.pg_namespace n"
563+
" FROM pg_catalog.pg_class c"
564+
" INNER JOIN pg_catalog.pg_namespace n"
565+
" ON (c.relnamespace = n.oid)"
565566
" WHERE n.nspname = %s"
566567
" AND c.relname = %s"
567568
" AND c.relkind = 'r'",

0 commit comments

Comments
 (0)