diff options
| author | Tom Lane | 2007-07-25 22:16:18 +0000 |
|---|---|---|
| committer | Tom Lane | 2007-07-25 22:16:18 +0000 |
| commit | 82eed4dba254b8fda71d429b29d222ffb4e93fca (patch) | |
| tree | eb84bdb8b70e931a08c23c07bc5c83d305bf19b3 /contrib | |
| parent | fdb5b69e9c8f7186fe43c21580ac2ba45db1740f (diff) | |
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.
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/oid2name/oid2name.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/oid2name/oid2name.c b/contrib/oid2name/oid2name.c index 691b2f28d19..35779798875 100644 --- a/contrib/oid2name/oid2name.c +++ b/contrib/oid2name/oid2name.c @@ -4,7 +4,7 @@ * * Originally by * B. Palmer, bpalmer@crimelabs.net 1-17-2001 - * $PostgreSQL: pgsql/contrib/oid2name/oid2name.c,v 1.31 2007/07/15 22:54:20 tgl Exp $ + * $PostgreSQL: pgsql/contrib/oid2name/oid2name.c,v 1.32 2007/07/25 22:16:17 tgl Exp $ */ #include "postgres_fe.h" @@ -411,7 +411,7 @@ sql_exec_dumpalltables(PGconn *conn, struct options * opts) " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace " " LEFT JOIN pg_catalog.pg_database d ON d.datname = current_database()," " pg_catalog.pg_tablespace t " - "WHERE relkind IN ('r'%s) AND " + "WHERE relkind IN ('r'%s%s) AND " " %s" " t.oid = CASE" " WHEN reltablespace <> 0 THEN reltablespace" @@ -419,8 +419,9 @@ sql_exec_dumpalltables(PGconn *conn, struct options * opts) " END " "ORDER BY relname", opts->extended ? addfields : "", - opts->indexes ? ", 'i', 'S', 't'" : "", - opts->systables ? "" : "n.nspname NOT IN ('pg_catalog', 'pg_toast', 'information_schema') AND"); + opts->indexes ? ", 'i', 'S'" : "", + opts->systables ? ", 't'" : "", + opts->systables ? "" : "n.nspname NOT IN ('pg_catalog', 'information_schema') AND n.nspname !~ '^pg_toast' AND"); sql_exec(conn, todo, opts->quiet); } |
