Re: Prevent extension creation in temporary schemas - Mailing list pgsql-hackers

From Chris Travers
Subject Re: Prevent extension creation in temporary schemas
Date
Msg-id CAN-RpxA9HmytWo=eVtyRRso7VMZs=gYPqU0ihBwN+gzv8zXo-g@mail.gmail.com
Whole thread Raw
In response to RE: Prevent extension creation in temporary schemas  ("Kuroda, Hayato" <kuroda.hayato@jp.fujitsu.com>)
List pgsql-hackers


On Mon, Feb 18, 2019 at 6:40 AM Kuroda, Hayato <kuroda.hayato@jp.fujitsu.com> wrote:
Dear Michael,

I seem this patch is enough, but could you explain the reason
you drop initial proposal more detail?
I'm not sure why extensions contained by temporary schemas are acceptable.

Here's my objection.

Everything a relocatable extension can create can be created normally in a temporary schema currently.  This includes types, functions, etc.

So I can create a type in a temporary schema and then create a table in a public schema using that type as a column.  This behaves oddly (when I log out of my session the column gets implicitly dropped) but it works consistently.  Adding special cases to extensions strikes me as adding more funny corners to the behavior of the db in this regard.

Now there are times I could imagine using temporary schemas with extensions.  This could include testing multiple versions of an extension so that multiple concurrent test runs don't see each other's versions.  This could be done with normal schemas but the guarantees are not as strong regarding cleanup.

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

Extensions locate at pg_temp_* schemas are temporary objects IMO.
How do you think? Would you implement this functionality in future?

That's the way things are now as far as I understand it, or do I misunderstand your question? 

Hayato Kuroda
Fujitsu LIMITED



--
Best Regards,
Chris Travers
Head of Database

Tel: +49 162 9037 210 | Skype: einhverfr | www.adjust.com 
Saarbrücker Straße 37a, 10405 Berlin

pgsql-hackers by date:

Previous
From: Michael Meskes
Date:
Subject: Re: [PROPOSAL]a new data type 'bytea' for ECPG
Next
From: Masahiko Sawada
Date:
Subject: Re: Prevent extension creation in temporary schemas