Re: Postgresql : pg_temp & pg_toast_temp

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vishwanath Kummera <kvishu83(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Postgresql : pg_temp & pg_toast_temp
Date: 2023-12-07 14:09:05
Message-ID: 1265147.1701958145@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Vishwanath Kummera <kvishu83(at)gmail(dot)com> writes:
> I am seeing there are many schemas created, this is specially when
> enabled "CONCURRENTLY" option for refreshing materialized views through
> table trigger.

> pg_temp_1... pg_temp_30
> pg_toast_temp_1... pg_toast_temp_30

Yes, that's by design. There's a separate temp schema for each backend
session "slot", which gets created when first needed.

> If this is by design the temp schemas get created with the "CONCURRENTLY"
> option, is there any way to clean-up them automatically?

No. It'd just lead to thrashing/bloat in the pg_namespace catalog,
since they'd be needed again eventually.

regards, tom lane

> Thanks,
> Vishu

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2023-12-07 14:11:08 Re: Emitting JSON to file using COPY TO
Previous Message Joe Conway 2023-12-07 13:56:41 Re: Emitting JSON to file using COPY TO