Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 81fc5df

Browse files
committed
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.)
1 parent dbca713 commit 81fc5df

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/bin/psql/describe.c

+10-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
1010
*
11-
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.205 2009/04/02 17:38:26 momjian Exp $
11+
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.206 2009/04/04 00:41:11 tgl Exp $
1212
*/
1313
#include "postgres_fe.h"
1414

@@ -2029,8 +2029,15 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys
20292029

20302030
if (!showSystem && !pattern)
20312031
appendPQExpBuffer(&buf, " AND n.nspname <> 'pg_catalog'\n"
2032-
" AND n.nspname <> 'information_schema'\n"
2033-
" AND n.nspname !~ '^pg_toast'\n");
2032+
" AND n.nspname <> 'information_schema'\n");
2033+
2034+
/*
2035+
* TOAST objects are suppressed unconditionally. Since we don't provide
2036+
* any way to select relkind 't' above, we would never show toast tables
2037+
* in any case; it seems a bit confusing to allow their indexes to be
2038+
* shown. Use plain \d if you really need to look at a TOAST table/index.
2039+
*/
2040+
appendPQExpBuffer(&buf, " AND n.nspname !~ '^pg_toast'\n");
20342041

20352042
processSQLNamePattern(pset.db, &buf, pattern, true, false,
20362043
"n.nspname", "c.relname", NULL,

0 commit comments

Comments
 (0)