*/
-/* \da
+/*
+ * \da
* Takes an optional regexp to select particular aggregates
*/
bool
return true;
}
-/* \dA
+/*
+ * \dA
* Takes an optional regexp to select particular access methods
*/
bool
return true;
}
-/* \db
+/*
+ * \db
* Takes an optional regexp to select particular tablespaces
*/
bool
}
-/* \df
+/*
+ * \df
* Takes an optional regexp to select particular functions.
*
* As with \d, you can specify the kinds of functions you want:
}
-/* \do
+/*
+ * \do
* Describe operators
*/
bool
"WHERE oid = '%u';", tablespace);
result = PSQLexec(buf.data);
if (!result)
+ {
+ termPQExpBuffer(&buf);
return;
+ }
/* Should always be the case, but.... */
if (PQntuples(result) > 0)
{
PQExpBufferData buf;
PGresult *res;
printQueryOpt myopt = pset.popt;
+ bool havewhere;
- initPQExpBuffer(&buf);
-
- if (pset.sversion >= 90000)
- {
- bool havewhere;
-
- printfPQExpBuffer(&buf, "SELECT rolname AS \"%s\", datname AS \"%s\",\n"
- "pg_catalog.array_to_string(setconfig, E'\\n') AS \"%s\"\n"
- "FROM pg_catalog.pg_db_role_setting s\n"
- "LEFT JOIN pg_catalog.pg_database d ON d.oid = setdatabase\n"
- "LEFT JOIN pg_catalog.pg_roles r ON r.oid = setrole\n",
- gettext_noop("Role"),
- gettext_noop("Database"),
- gettext_noop("Settings"));
- havewhere = processSQLNamePattern(pset.db, &buf, pattern, false, false,
- NULL, "r.rolname", NULL, NULL);
- processSQLNamePattern(pset.db, &buf, pattern2, havewhere, false,
- NULL, "d.datname", NULL, NULL);
- appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
- }
- else
+ if (pset.sversion < 90000)
{
- fprintf(pset.queryFout,
- _("No per-database role settings support in this server version.\n"));
- return false;
+ char sverbuf[32];
+
+ psql_error("The server (version %s) does not support per-database role settings.\n",
+ formatPGVersionNumber(pset.sversion, false,
+ sverbuf, sizeof(sverbuf)));
+ return true;
}
+ initPQExpBuffer(&buf);
+
+ printfPQExpBuffer(&buf, "SELECT rolname AS \"%s\", datname AS \"%s\",\n"
+ "pg_catalog.array_to_string(setconfig, E'\\n') AS \"%s\"\n"
+ "FROM pg_catalog.pg_db_role_setting s\n"
+ "LEFT JOIN pg_catalog.pg_database d ON d.oid = setdatabase\n"
+ "LEFT JOIN pg_catalog.pg_roles r ON r.oid = setrole\n",
+ gettext_noop("Role"),
+ gettext_noop("Database"),
+ gettext_noop("Settings"));
+ havewhere = processSQLNamePattern(pset.db, &buf, pattern, false, false,
+ NULL, "r.rolname", NULL, NULL);
+ processSQLNamePattern(pset.db, &buf, pattern2, havewhere, false,
+ NULL, "d.datname", NULL, NULL);
+ appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
+
res = PSQLexec(buf.data);
+ termPQExpBuffer(&buf);
if (!res)
return false;
}
PQclear(res);
- resetPQExpBuffer(&buf);
return true;
}
return true;
}
-/* \dRp
+/*
+ * \dRp
* Lists publications.
*
* Takes an optional regexp to select particular publications
return true;
}
-/* \dRp+
+/*
+ * \dRp+
* Describes publications including the contents.
*
* Takes an optional regexp to select particular publications
return true;
}
-/* \dRs
+/*
+ * \dRs
* Describes subscriptions.
*
* Takes an optional regexp to select particular subscriptions