From 17a957d6a35ca07548731b29f9ae64dfa1b13e10 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 4 Apr 2009 00:41:11 +0000 Subject: [PATCH] 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.) --- src/bin/psql/describe.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 4db131b2cf..ae64df6c37 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -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, -- 2.39.5