Re: Why lots of temp schemas are being created

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Why lots of temp schemas are being created
Date: 2009-06-09 00:31:46
Message-ID: 4A2DAD72.4030603@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

On 08/06/09 13:57, Anirban Pal wrote:
> Dear all,
> Our software use postgres as backend database. It works fine, strange
> thing is that, it creates so many temporary schemas under schema tab,
> names like pg_toast, pg_toast_temp_1 like this upto pg_toast_temp40.
> This schemas also reflected in "pg_namespace" table. Can anybody tell
> me, is there anything wrong in it? Should I get rid of these
> temporary schemas? Any suggestion on this, please.

Each transaction's temporary tables are isolated from each other by
putting them in a different schema. That's why you can have the same
temp table name in several concurrent transactions. Pg automatically
creates new schema if there aren't enough for all the concurrent
transactions.

The pg_toast_temp schema are for the TOAST tables associated with those
temp tables. Normal tables may have associated TOAST tables containing
out-of-line and/or compressed data. They normally live in the pg_toast
schema. To prevent naming conflicts when two temp tables of the same
name both have TOAST tables, separate pg_toast_temp schema must be
created for them.

Don't delete them or mess with them, and just examine the pg_namespace
system table with something like:

select * from pg_namespace where not nspname like 'pg_%';

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Yaroslav Tykhiy 2009-06-09 02:38:05 Re: Move PGdata to a different drive
Previous Message Ron Mayer 2009-06-09 00:25:25 Re: INTERVAL SECOND limited to 59 seconds?

Browse pgsql-novice by date

  From Date Subject
Next Message Merlin Moncure 2009-06-09 14:34:27 Re: Why lots of temp schemas are being created
Previous Message Bruce Hyatt 2009-06-08 22:49:36 Re: Yum Update Errors