mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Arrange to put TOAST tables belonging to temporary tables into special schemas
named pg_toast_temp_nnn, alongside the pg_temp_nnn schemas used for the temp tables themselves. This allows low-level code such as the relcache to recognize that these tables are indeed temporary, which enables various optimizations such as not WAL-logging changes and using local rather than shared buffers for access. Aside from obvious performance benefits, this provides a solution to bug #3483, in which other backends unexpectedly held open file references to temporary tables. The scheme preserves the property that TOAST tables are not in any schema that's normally in the search path, so they don't conflict with user table names. initdb forced because of changes in system view definitions.
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (c) 2000-2007, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.156 2007/06/28 06:40:16 neilc Exp $
|
||||
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.157 2007/07/25 22:16:18 tgl Exp $
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
#include "describe.h"
|
||||
@ -1688,9 +1688,12 @@ listTables(const char *tabtypes, const char *pattern, bool verbose)
|
||||
* pg_catalog and pg_toast. (We don't want to hide temp tables though.)
|
||||
*/
|
||||
if (showSystem)
|
||||
appendPQExpBuffer(&buf, " AND n.nspname = 'pg_catalog'\n");
|
||||
appendPQExpBuffer(&buf,
|
||||
" AND n.nspname = 'pg_catalog'\n");
|
||||
else
|
||||
appendPQExpBuffer(&buf, " AND n.nspname NOT IN ('pg_catalog', 'pg_toast')\n");
|
||||
appendPQExpBuffer(&buf,
|
||||
" AND n.nspname <> 'pg_catalog'\n"
|
||||
" AND n.nspname !~ '^pg_toast'\n");
|
||||
|
||||
processSQLNamePattern(pset.db, &buf, pattern, true, false,
|
||||
"n.nspname", "c.relname", NULL,
|
||||
|
Reference in New Issue
Block a user