Re: Another thought about search_path semantics - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Another thought about search_path semantics
Date
Msg-id 20140404184350.GD26295@awork2.anarazel.de
Whole thread Raw
In response to Re: Another thought about search_path semantics  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Another thought about search_path semantics  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2014-04-04 14:32:46 -0400, Tom Lane wrote:
> Andres Freund <andres@2ndquadrant.com> writes:
> > I was thinking - but not saying explicitly - of rigging things so that
> > pg_catalog is ignored when searching for the target schema for object
> > creation unless explicitly specified. So if there's no other schema in
> > the search path you'd get the error about no "no schema has been
> > selected to create in", even if pg_catalog is somewhere in there.
> 
> Hm.  Seems pretty grotty, but it'd at least fix pg_dump's problem,
> since pg_dump's lists are always "foo, pg_catalog" with no third
> schema mentioned.  I think what we'd actually need is to say
> "pg_catalog cannot be selected as the creation target unless it's
> the *first* entry in the search_path list".

I was actually suggesting that the only way to create something in
pg_catalog is to do it with a explicit schema qualified id. I realize
that that's not something backpatchable...

> The larger issue here is that if search_path is say "a, b, c" and
> "a" doesn't exist, is it really sane to create in "b" instead?

I think "$user" really nailed that behaviour down. Everything else just
seems really confusing. We could of course make that behave special as
you suggest, but yuck.


Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Another thought about search_path semantics
Next
From: Tom Lane
Date:
Subject: Re: Another thought about search_path semantics