Commit 61ecc90b authored by Peter Eisentraut's avatar Peter Eisentraut

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>
parent e495c168
...@@ -560,8 +560,9 @@ fetch_remote_table_info(char *nspname, char *relname, ...@@ -560,8 +560,9 @@ fetch_remote_table_info(char *nspname, char *relname,
/* First fetch Oid and replica identity. */ /* First fetch Oid and replica identity. */
initStringInfo(&cmd); initStringInfo(&cmd);
appendStringInfo(&cmd, "SELECT c.oid, c.relreplident" appendStringInfo(&cmd, "SELECT c.oid, c.relreplident"
" FROM pg_catalog.pg_class c," " FROM pg_catalog.pg_class c"
" pg_catalog.pg_namespace n" " INNER JOIN pg_catalog.pg_namespace n"
" ON (c.relnamespace = n.oid)"
" WHERE n.nspname = %s" " WHERE n.nspname = %s"
" AND c.relname = %s" " AND c.relname = %s"
" AND c.relkind = 'r'", " AND c.relkind = 'r'",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment