Re: Prevent extension creation in temporary schemas

2019-03-06 Thread Michael Paquier
On Wed, Mar 06, 2019 at 09:33:55AM +0100, Chris Travers wrote: > Ok so at present I see three distinct issues here, where maybe three > different patches over time might be needed. > > The issues are: > > 1. create extension pgcrypto with schema pg_temp; fails because there is > no schema

Re: Prevent extension creation in temporary schemas

2019-03-06 Thread Chris Travers
On Wed, Mar 6, 2019 at 9:33 AM Chris Travers wrote: > > >> Thoughts? >> > To re-iterate, my experience with PostgreSQL is that people doing particularly exotic work in PostgreSQL can expect to hit equally exotic bugs. I have a list that I will not bore people with here. I think there is a

Re: Prevent extension creation in temporary schemas

2019-03-06 Thread Chris Travers
On Wed, Mar 6, 2019 at 3:19 AM Michael Paquier wrote: > On Tue, Mar 05, 2019 at 12:47:54PM +, Chris Travers wrote: > > I tried installing a test extension into a temp schema. I found > > this was remarkably difficult to do because pg_temp did not work (I > > had to create a temporary table

Re: Prevent extension creation in temporary schemas

2019-03-05 Thread Michael Paquier
On Tue, Mar 05, 2019 at 12:47:54PM +, Chris Travers wrote: > I tried installing a test extension into a temp schema. I found > this was remarkably difficult to do because pg_temp did not work (I > had to create a temporary table and then locate the actual table it > was created in). While

Re: Prevent extension creation in temporary schemas

2019-03-05 Thread Chris Travers
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:not tested I ran make checkworld and everything passed. I tried installing

Re: Prevent extension creation in temporary schemas

2019-03-01 Thread Tom Lane
Michael Paquier writes: > On Thu, Feb 28, 2019 at 10:52:52PM -0500, Tom Lane wrote: >> If you're suggesting that we disable that security restriction >> during extension creation, I really can't see how that'd be a >> good thing ... > No, I don't mean that. I was just wondering if someone can

Re: Prevent extension creation in temporary schemas

2019-02-28 Thread Michael Paquier
On Thu, Feb 28, 2019 at 10:52:52PM -0500, Tom Lane wrote: > If you're suggesting that we disable that security restriction > during extension creation, I really can't see how that'd be a > good thing ... No, I don't mean that. I was just wondering if someone can set search_path within the SQL

Re: Prevent extension creation in temporary schemas

2019-02-28 Thread Tom Lane
Michael Paquier writes: > On Thu, Feb 28, 2019 at 10:13:17AM -0500, Tom Lane wrote: >> Yeah, I think it's just because we won't search the pg_temp schema >> for function or operator names, unless the calling SQL command >> explicitly writes "pg_temp.foo(...)" or equivalent. That's an >> ancient

Re: Prevent extension creation in temporary schemas

2019-02-28 Thread Michael Paquier
On Thu, Feb 28, 2019 at 10:13:17AM -0500, Tom Lane wrote: > Yeah, I think it's just because we won't search the pg_temp schema > for function or operator names, unless the calling SQL command > explicitly writes "pg_temp.foo(...)" or equivalent. That's an > ancient security decision, which we're

Re: Prevent extension creation in temporary schemas

2019-02-28 Thread Tom Lane
Sergei Kornilov writes: >> test=> CREATE EXTENSION file_fdw WITH SCHEMA pg_temp_3; >> ERROR: function file_fdw_handler() does not exist > This behavior seems as not related to extensions infrastructure: Yeah, I think it's just because we won't search the pg_temp schema for function or operator

Re: Prevent extension creation in temporary schemas

2019-02-28 Thread Sergei Kornilov
Hi > I found that this strange error appears after making > temporary tables. > > test=> CREATE TEMPORARY TABLE temp (id int); > CREATE TABLE > test=> CREATE EXTENSION file_fdw WITH SCHEMA pg_temp_3; > ERROR: function file_fdw_handler() does not exist > > I would try to understand this problem

RE: Prevent extension creation in temporary schemas

2019-02-27 Thread Kuroda, Hayato
Dear Michael, Chris and Tom, > Adding special cases to extensions strikes me as adding more > funny corners to the behavior of the db in this regard. I understand your arguments and its utility. > For most of extensions, this can randomly finish with strange error > messages, say that: > =#

Re: Prevent extension creation in temporary schemas

2019-02-18 Thread Tom Lane
Michael Paquier writes: > On Mon, Feb 18, 2019 at 05:39:09AM +, Kuroda, Hayato wrote: >> I'm not sure why extensions contained by temporary schemas are >> acceptable. > Because there are cases where they actually work. More to the point, it doesn't seem that hard to think of cases where

Re: Prevent extension creation in temporary schemas

2019-02-18 Thread Michael Paquier
On Mon, Feb 18, 2019 at 08:02:54PM +0900, Masahiko Sawada wrote: > I'd vote for accepting the extension creation in temporary schemas and > fixing \dx and \dx+. Thanks. > However the error raised by creating extensions > in temporary schema still looks strange to me. Since we don't search >

Re: Prevent extension creation in temporary schemas

2019-02-18 Thread Michael Paquier
On Mon, Feb 18, 2019 at 05:39:09AM +, Kuroda, Hayato wrote: > 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. Because there are cases where they actually

Re: Prevent extension creation in temporary schemas

2019-02-18 Thread Masahiko Sawada
On Thu, Feb 14, 2019 at 4:57 PM Michael Paquier wrote: > > 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

Re: Prevent extension creation in temporary schemas

2019-02-18 Thread Chris Travers
On Mon, Feb 18, 2019 at 6:40 AM Kuroda, Hayato 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

RE: Prevent extension creation in temporary schemas

2019-02-17 Thread Kuroda, Hayato
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. > Anything depending on a temporary object will be dropped per > dependency links once the session is

Re: Prevent extension creation in temporary schemas

2019-02-13 Thread Michael Paquier
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

Re: Prevent extension creation in temporary schemas

2019-02-13 Thread Chris Travers
On Sat, Jan 12, 2019 at 12:48 AM Michael Paquier wrote: > On Sat, Jan 12, 2019 at 08:34:37AM +0900, Michael Paquier wrote: > > Then the extension is showing up as beginning to be present for other > > users. I am mainly wondering if this case has actually been thought > > about in the past or

Re: Prevent extension creation in temporary schemas

2019-02-04 Thread Chris Travers
This could probably use a quick note in the docs.

Re: Prevent extension creation in temporary schemas

2019-01-11 Thread Michael Paquier
On Sat, Jan 12, 2019 at 08:34:37AM +0900, Michael Paquier wrote: > Then the extension is showing up as beginning to be present for other > users. I am mainly wondering if this case has actually been thought > about in the past or discussed, and what to do about that and if we > need to do

Re: Prevent extension creation in temporary schemas

2019-01-11 Thread Michael Paquier
On Fri, Jan 11, 2019 at 02:22:01PM -0500, Robert Haas wrote: > On Sun, Jan 6, 2019 at 10:26 PM Michael Paquier wrote: >> This combination makes no actual sense, so wouldn't it be better to >> restrict the case? > > Hmm. What exactly doesn't make sense about it? In my mind, extensions are

Re: Prevent extension creation in temporary schemas

2019-01-11 Thread Robert Haas
On Sun, Jan 6, 2019 at 10:26 PM Michael Paquier wrote: > This combination makes no actual sense, so wouldn't it be better to > restrict the case? Hmm. What exactly doesn't make sense about it? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company