Re: Prevent extension creation in temporary schemas

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Chris Travers <chris(dot)travers(at)adjust(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, dimitri(at)citusdata(dot)com
Subject: Re: Prevent extension creation in temporary schemas
Date: 2019-02-14 07:56:48
Message-ID: 20190214075648.GG2366@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

On Wed, Feb 13, 2019 at 12:08:50PM +0100, Chris Travers wrote:
> If the point is visibility in \dx it seems to me we want to fix the \dx
> query.

Yes, I got to think a bit more about that case, and there are cases
where this actually works properly as this depends on the objects
defined in the extension. Fixing \dx to not show up extensions
defined in temp schemas of other sessions is definitely a must in my
opinion, and I would rather drop the rest of the proposal for now. A
similar treatment is needed for \dx+.

> For example: suppose I create a type in pg_temp and create a table in
> public with a column using that type.

I am wondering if this scenario could make sense to populate data on
other, existing, relations for a schema migration, and that a two-step
process is done, with temporary tables used as intermediates. But
that sounds like the thoughts of a crazy man..

> What is the expected visibility in other sessions?
>
> What happens to the table when I log out?

Anything depending on a temporary object will be dropped per
dependency links once the session is over.

Attached is a patch to adjust \dx and \dx+. What do you think?
--
Michael

Attachment Content-Type Size
psql-dx-temp.patch text/x-diff 1.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-02-14 08:10:27 Re: pg_basebackup ignores the existing data directory permissions
Previous Message Higuchi, Daisuke 2019-02-14 07:39:50 [Bug Fix] ECPG: could not use some CREATE TABLE AS syntax