"n.nspname", "p.proname", NULL,
"pg_catalog.pg_function_is_visible(p.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2, 4;");
NULL, "amname", NULL,
NULL,
NULL, 1))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1;");
NULL, "spcname", NULL,
NULL,
NULL, 1))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1;");
"n.nspname", "p.proname", NULL,
"pg_catalog.pg_function_is_visible(p.oid)",
NULL, 3))
- return false;
+ goto error_return;
for (int i = 0; i < num_arg_patterns; i++)
{
true, false,
nspname, typname, ft, tiv,
NULL, 3))
- return false;
+ goto error_return;
}
else
{
PQclear(res);
return true;
+
+error_return:
+ termPQExpBuffer(&buf);
+ return false;
}
"pg_catalog.format_type(t.oid, NULL)",
"pg_catalog.pg_type_is_visible(t.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
"n.nspname", "o.oprname", NULL,
"pg_catalog.pg_operator_is_visible(o.oid)",
NULL, 3))
- return false;
+ goto error_return;
if (num_arg_patterns == 1)
appendPQExpBufferStr(&buf, " AND o.oprleft = 0\n");
true, false,
nspname, typname, ft, tiv,
NULL, 3))
- return false;
+ goto error_return;
}
else
{
PQclear(res);
return true;
+
+error_return:
+ termPQExpBuffer(&buf);
+ return false;
}
" JOIN pg_catalog.pg_tablespace t on d.dattablespace = t.oid\n");
if (pattern)
+ {
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL, "d.datname", NULL, NULL,
NULL, 1))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1;");
res = PSQLexec(buf.data);
"n.nspname", "c.relname", NULL,
"n.nspname !~ '^pg_' AND pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
- return false;
+ goto error_return;
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
res = PSQLexec(buf.data);
if (!res)
- {
- termPQExpBuffer(&buf);
- return false;
- }
+ goto error_return;
myopt.nullPrint = NULL;
printfPQExpBuffer(&buf, _("Access privileges"));
termPQExpBuffer(&buf);
PQclear(res);
return true;
+
+error_return:
+ termPQExpBuffer(&buf);
+ return false;
}
"pg_catalog.pg_get_userbyid(d.defaclrole)",
NULL,
NULL, 3))
- return false;
+ goto error_return;
appendPQExpBufferStr(&buf, "ORDER BY 1, 2, 3;");
res = PSQLexec(buf.data);
if (!res)
- {
- termPQExpBuffer(&buf);
- return false;
- }
+ goto error_return;
myopt.nullPrint = NULL;
printfPQExpBuffer(&buf, _("Default access privileges"));
termPQExpBuffer(&buf);
PQclear(res);
return true;
+
+error_return:
+ termPQExpBuffer(&buf);
+ return false;
}
false, "n.nspname", "pgc.conname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
- return false;
+ goto error_return;
/* Domain constraint descriptions */
appendPQExpBuffer(&buf,
false, "n.nspname", "pgc.conname", NULL,
"pg_catalog.pg_type_is_visible(t.oid)",
NULL, 3))
- return false;
+ goto error_return;
/* Operator class descriptions */
appendPQExpBuffer(&buf,
"n.nspname", "o.opcname", NULL,
"pg_catalog.pg_opclass_is_visible(o.oid)",
NULL, 3))
- return false;
+ goto error_return;
/* Operator family descriptions */
appendPQExpBuffer(&buf,
"n.nspname", "opf.opfname", NULL,
"pg_catalog.pg_opfamily_is_visible(opf.oid)",
NULL, 3))
- return false;
+ goto error_return;
/* Rule descriptions (ignore rules for views) */
appendPQExpBuffer(&buf,
"n.nspname", "r.rulename", NULL,
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
- return false;
+ goto error_return;
/* Trigger descriptions */
appendPQExpBuffer(&buf,
"n.nspname", "t.tgname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
- return false;
+ goto error_return;
appendPQExpBufferStr(&buf,
") AS tt\n"
PQclear(res);
return true;
+
+error_return:
+ termPQExpBuffer(&buf);
+ return false;
}
"n.nspname", "c.relname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 2, 3;");
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL, "r.rolname", NULL, NULL,
NULL, 1))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1;");
gettext_noop("Settings"));
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL, "r.rolname", NULL, NULL, &havewhere, 1))
- return false;
+ goto error_return;
if (!validateSQLNamePattern(&buf, pattern2, havewhere, false,
NULL, "d.datname", NULL, NULL,
NULL, 1))
- return false;
+ goto error_return;
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
res = PSQLexec(buf.data);
PQclear(res);
return true;
+
+error_return:
+ termPQExpBuffer(&buf);
+ return false;
}
"n.nspname", "c.relname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1,2;");
"n.nspname", "c.relname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBuffer(&buf, "ORDER BY \"Schema\", %s%s\"Name\";",
mixed_output ? "\"Type\" DESC, " : "",
gettext_noop("Description"));
if (pattern)
+ {
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL, "l.lanname", NULL, NULL,
NULL, 2))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
+ }
if (!showSystem && !pattern)
appendPQExpBufferStr(&buf, "WHERE l.lanplcallfoid != 0\n");
"n.nspname", "t.typname", NULL,
"pg_catalog.pg_type_is_visible(t.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
"n.nspname", "c.conname", NULL,
"pg_catalog.pg_conversion_is_visible(c.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL, "evtname", NULL, NULL,
NULL, 1))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1");
"es.stxnamespace::pg_catalog.regnamespace::pg_catalog.text", "es.stxname",
NULL, "pg_catalog.pg_statistics_obj_is_visible(es.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
"pg_catalog.format_type(ts.oid, NULL)",
"pg_catalog.pg_type_is_visible(ts.oid)",
NULL, 3))
- return false;
+ goto error_return;
appendPQExpBufferStr(&buf, ") OR (true");
"pg_catalog.format_type(tt.oid, NULL)",
"pg_catalog.pg_type_is_visible(tt.oid)",
NULL, 3))
- return false;
+ goto error_return;
appendPQExpBufferStr(&buf, ") )\nORDER BY 1, 2;");
PQclear(res);
return true;
+
+error_return:
+ termPQExpBuffer(&buf);
+ return false;
}
/*
"n.nspname", "c.collname", NULL,
"pg_catalog.pg_collation_is_visible(c.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
NULL, "n.nspname", NULL,
NULL,
NULL, 2))
- return false;
+ goto error_return;
appendPQExpBufferStr(&buf, "ORDER BY 1;");
res = PSQLexec(buf.data);
if (!res)
- {
- termPQExpBuffer(&buf);
- return false;
- }
+ goto error_return;
myopt.nullPrint = NULL;
myopt.title = _("List of schemas");
pattern);
result = PSQLexec(buf.data);
if (!result)
- {
- termPQExpBuffer(&buf);
- return false;
- }
+ goto error_return;
else
pub_schema_tuples = PQntuples(result);
}
return true;
+
+error_return:
+ termPQExpBuffer(&buf);
+ return false;
}
"n.nspname", "p.prsname", NULL,
"pg_catalog.pg_ts_parser_is_visible(p.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
"n.nspname", "p.prsname", NULL,
"pg_catalog.pg_ts_parser_is_visible(p.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
res = PSQLexec(buf.data);
termPQExpBuffer(&buf);
if (!res)
+ {
+ termPQExpBuffer(&title);
return false;
+ }
myopt.nullPrint = NULL;
if (nspname)
"n.nspname", "d.dictname", NULL,
"pg_catalog.pg_ts_dict_is_visible(d.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
"n.nspname", "t.tmplname", NULL,
"pg_catalog.pg_ts_template_is_visible(t.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
"n.nspname", "c.cfgname", NULL,
"pg_catalog.pg_ts_config_is_visible(c.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
"n.nspname", "c.cfgname", NULL,
"pg_catalog.pg_ts_config_is_visible(c.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 3, 2;");
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL, "fdwname", NULL, NULL,
NULL, 1))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1;");
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL, "s.srvname", NULL, NULL,
NULL, 1))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1;");
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL, "um.srvname", "um.usename", NULL,
NULL, 1))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
"n.nspname", "c.relname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
NULL, "e.extname", NULL,
NULL,
NULL, 1))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1;");
NULL, "e.extname", NULL,
NULL,
NULL, 1))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1;");
{
pg_log_error("improper qualified name (too many dotted names): %s",
pattern);
- termPQExpBuffer(&dbbuf);
- return false;
+ goto error_return;
}
if (maxparts > 1 && dotcnt == maxparts - 1)
if (PQdb(pset.db) == NULL)
{
pg_log_error("You are currently not connected to a database.");
- return false;
+ goto error_return;
}
if (strcmp(PQdb(pset.db), dbbuf.data) != 0)
{
pg_log_error("cross-database references are not implemented: %s",
pattern);
- return false;
+ goto error_return;
}
}
+ termPQExpBuffer(&dbbuf);
return true;
+
+error_return:
+ termPQExpBuffer(&dbbuf);
+ return false;
}
/*
NULL, "pubname", NULL,
NULL,
NULL, 1))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1;");
NULL, "pubname", NULL,
NULL,
NULL, 1))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 2;");
NULL, "subname", NULL,
NULL,
NULL, 1))
+ {
+ termPQExpBuffer(&buf);
return false;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1;");
if (!validateSQLNamePattern(&buf, access_method_pattern,
false, false, NULL, "am.amname", NULL, NULL,
&have_where, 1))
- return false;
+ goto error_return;
if (type_pattern)
{
/* Match type name pattern against either internal or external name */
"pg_catalog.format_type(t.oid, NULL)",
"pg_catalog.pg_type_is_visible(t.oid)",
NULL, 3))
- return false;
+ goto error_return;
}
appendPQExpBufferStr(&buf, "ORDER BY 1, 2, 4;");
PQclear(res);
return true;
+
+error_return:
+ termPQExpBuffer(&buf);
+ return false;
}
/*
if (!validateSQLNamePattern(&buf, access_method_pattern,
false, false, NULL, "am.amname", NULL, NULL,
&have_where, 1))
- return false;
+ goto error_return;
if (type_pattern)
{
appendPQExpBuffer(&buf,
"pg_catalog.format_type(t.oid, NULL)",
"pg_catalog.pg_type_is_visible(t.oid)",
NULL, 3))
- return false;
+ goto error_return;
appendPQExpBufferStr(&buf, " )\n");
}
PQclear(res);
return true;
+
+error_return:
+ termPQExpBuffer(&buf);
+ return false;
}
/*
" LEFT JOIN pg_catalog.pg_opfamily ofs ON ofs.oid = o.amopsortfamily\n");
if (access_method_pattern)
+ {
if (!validateSQLNamePattern(&buf, access_method_pattern,
false, false, NULL, "am.amname",
NULL, NULL,
&have_where, 1))
- return false;
+ goto error_return;
+ }
if (family_pattern)
+ {
if (!validateSQLNamePattern(&buf, family_pattern, have_where, false,
"nsf.nspname", "of.opfname", NULL, NULL,
NULL, 3))
- return false;
+ goto error_return;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2,\n"
" o.amoplefttype = o.amoprighttype DESC,\n"
PQclear(res);
return true;
+
+error_return:
+ termPQExpBuffer(&buf);
+ return false;
}
/*
" LEFT JOIN pg_catalog.pg_proc p ON ap.amproc = p.oid\n");
if (access_method_pattern)
+ {
if (!validateSQLNamePattern(&buf, access_method_pattern,
false, false, NULL, "am.amname",
NULL, NULL,
&have_where, 1))
- return false;
+ goto error_return;
+ }
if (family_pattern)
+ {
if (!validateSQLNamePattern(&buf, family_pattern, have_where, false,
"ns.nspname", "of.opfname", NULL, NULL,
NULL, 3))
- return false;
+ goto error_return;
+ }
appendPQExpBufferStr(&buf, "ORDER BY 1, 2,\n"
" ap.amproclefttype = ap.amprocrighttype DESC,\n"
PQclear(res);
return true;
+
+error_return:
+ termPQExpBuffer(&buf);
+ return false;
}
/*