<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.76 2002/09/21 18:32:54 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.77 2002/09/22 20:44:22 tgl Exp $
PostgreSQL documentation
-->
This is not the actual command name: the letters i, s, t, v, S
stand for index, sequence, table, view, and system table,
respectively. You can specify any or all of these letters, in any
- order, to obtain a listing of all the matching objects.
+ order, to obtain a listing of all the matching objects. The letter
+ S restricts the listing to system objects; without S, only non-system
+ objects are shown.
If <quote>+</quote> is appended to the command name, each object is
listed with its associated description, if any.
</para>
*
* Copyright 2000-2002 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.68 2002/09/04 20:31:35 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.69 2002/09/22 20:44:22 tgl Exp $
*/
#include "postgres_fe.h"
#include "describe.h"
* i - indexes
* v - views
* s - sequences
- * S - system tables (~ '^pg_')
+ * S - system tables (pg_catalog)
* (any order of the above is fine)
*/
bool
PGresult *res;
printQueryOpt myopt = pset.popt;
- if (showSystem && !(showSeq || showIndexes || showViews || showTables))
+ if (!(showTables || showIndexes || showViews || showSeq))
showTables = showViews = showSeq = true;
initPQExpBuffer(&buf);
appendPQExpBuffer(&buf, ")\n");
/*
- * Unless showSystem is specified, we suppress system tables, ie,
+ * If showSystem is specified, show only system objects (those in
+ * pg_catalog). Otherwise, suppress system objects, including
* those in pg_catalog and pg_toast. (We don't want to hide temp
* tables though.)
*/
if (showSystem)
- processNamePattern(&buf, pattern, true, false,
- "n.nspname", "c.relname", NULL,
- "pg_catalog.pg_table_is_visible(c.oid)");
+ appendPQExpBuffer(&buf, " AND n.nspname = 'pg_catalog'\n");
else
- processNamePattern(&buf, pattern, true, false,
- "n.nspname", "c.relname", NULL,
- "pg_catalog.pg_table_is_visible(c.oid) AND n.nspname <> 'pg_catalog' AND n.nspname <> 'pg_toast'");
+ appendPQExpBuffer(&buf, " AND n.nspname NOT IN ('pg_catalog', 'pg_toast')\n");
+
+ processNamePattern(&buf, pattern, true, false,
+ "n.nspname", "c.relname", NULL,
+ "pg_catalog.pg_table_is_visible(c.oid)");
appendPQExpBuffer(&buf, "ORDER BY 1,2;");