Re: management of pg-schemas: pg_temp_n and pg_toast_n ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Rostron <mrostron(at)ql2(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: management of pg-schemas: pg_temp_n and pg_toast_n ?
Date: 2010-09-18 18:50:07
Message-ID: 16387.1284835807@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Mark Rostron <mrostron(at)ql2(dot)com> writes:
> We do a lot of work with temp tables here, and over time a lot of pg_temp_[n] schemas have appeared.
> Similarly, we notice build-up of pg_toast_[n] schemas.

This is expected. There'll be one for each backend slot that's ever
used any temp tables.

> Is it ok to drop these if they contain no tables?

It's risky: you have the race condition that some backend might be just
starting to use a temp schema when you decide to blow away the schema.

It's also pretty pointless, since the schema will just come back again
next time it's needed. I'd say just ignore the temp schemas.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Anibal David Acosta 2010-09-20 14:55:59 Re: question about HA in PG 9.0
Previous Message Mark Rostron 2010-09-18 18:41:13 management of pg-schemas: pg_temp_n and pg_toast_n ?