aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-04-04 00:41:11 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-04-04 00:41:11 +0000
commit81fc5df83e9803443d3f31e5e810fbef63864452 (patch)
treece43e3881ec5051d93a2a5b7cfd616b0f06425b1 /src
parentdbca713cea2370514dd55807ef471ee9308ef017 (diff)
downloadpostgresql-81fc5df83e9803443d3f31e5e810fbef63864452.tar.gz
postgresql-81fc5df83e9803443d3f31e5e810fbef63864452.zip
Make \dt \di and friends more consistent about the treatment of
TOAST tables and indexes; to wit, never show either. (You can examine them with plain \d if you're really so inclined.)
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/describe.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 220c3c4770a..c78bd6f39ee 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -8,7 +8,7 @@
*
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.205 2009/04/02 17:38:26 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.206 2009/04/04 00:41:11 tgl Exp $
*/
#include "postgres_fe.h"
@@ -2029,8 +2029,15 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys
if (!showSystem && !pattern)
appendPQExpBuffer(&buf, " AND n.nspname <> 'pg_catalog'\n"
- " AND n.nspname <> 'information_schema'\n"
- " AND n.nspname !~ '^pg_toast'\n");
+ " AND n.nspname <> 'information_schema'\n");
+
+ /*
+ * TOAST objects are suppressed unconditionally. Since we don't provide
+ * any way to select relkind 't' above, we would never show toast tables
+ * in any case; it seems a bit confusing to allow their indexes to be
+ * shown. Use plain \d if you really need to look at a TOAST table/index.
+ */
+ appendPQExpBuffer(&buf, " AND n.nspname !~ '^pg_toast'\n");
processSQLNamePattern(pset.db, &buf, pattern, true, false,
"n.nspname", "c.relname", NULL,