resetPQExpBuffer(query);
+ /* Make sure we are in proper schema */
+ selectSourceSchema(fout, "pg_catalog");
+
/* Get the publications. */
appendPQExpBuffer(query,
"SELECT p.tableoid, p.oid, p.pubname, "
"(%s p.pubowner) AS rolname, "
"p.puballtables, p.pubinsert, p.pubupdate, p.pubdelete "
- "FROM pg_catalog.pg_publication p",
+ "FROM pg_publication p",
username_subquery);
res = ExecuteSqlQuery(fout, query->data, PGRES_TUPLES_OK);
query = createPQExpBuffer();
+ /* Make sure we are in proper schema */
+ selectSourceSchema(fout, "pg_catalog");
+
for (i = 0; i < numTables; i++)
{
TableInfo *tbinfo = &tblinfo[i];
/* Get the publication membership for the table. */
appendPQExpBuffer(query,
"SELECT pr.tableoid, pr.oid, p.pubname "
- "FROM pg_catalog.pg_publication_rel pr,"
- " pg_catalog.pg_publication p "
+ "FROM pg_publication_rel pr, pg_publication p "
"WHERE pr.prrelid = '%u'"
" AND p.oid = pr.prpubid",
tbinfo->dobj.catId.oid);
if (dopt->no_subscriptions || fout->remoteVersion < 100000)
return;
+ /* Make sure we are in proper schema */
+ selectSourceSchema(fout, "pg_catalog");
+
if (!is_superuser(fout))
{
int n;
res = ExecuteSqlQuery(fout,
"SELECT count(*) FROM pg_subscription "
- "WHERE subdbid = (SELECT oid FROM pg_catalog.pg_database"
+ "WHERE subdbid = (SELECT oid FROM pg_database"
" WHERE datname = current_database())",
PGRES_TUPLES_OK);
n = atoi(PQgetvalue(res, 0, 0));
"(%s s.subowner) AS rolname, "
" s.subconninfo, s.subslotname, s.subsynccommit, "
" s.subpublications "
- "FROM pg_catalog.pg_subscription s "
- "WHERE s.subdbid = (SELECT oid FROM pg_catalog.pg_database"
+ "FROM pg_subscription s "
+ "WHERE s.subdbid = (SELECT oid FROM pg_database"
" WHERE datname = current_database())",
username_subquery);
res = ExecuteSqlQuery(fout, query->data, PGRES_TUPLES_OK);
"oid, "
"stxname, "
"pg_catalog.pg_get_statisticsobjdef(oid) AS stxdef "
- "FROM pg_statistic_ext "
+ "FROM pg_catalog.pg_statistic_ext "
"WHERE stxrelid = '%u' "
"ORDER BY stxname", tbinfo->dobj.catId.oid);