Skip site navigation (1) Skip section navigation (2)

Re: search_path vs extensions

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
Subject: Re: search_path vs extensions
Date: 2009-05-27 22:39:49
Message-ID: 31C25F1E-B7E1-40EC-9CC4-4E025D6525D1@kineticode.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On May 27, 2009, at 2:14 PM, Tom Lane wrote:

> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> Another way of handling this might be to provide for prepending or
>> appending to the search path (or even for removing items from it).
>
> I was just about to raise that as a requirement.

Yeah, I likes.

> Some folks on this
> list might recognize the following coding pattern:
>
> 	create schema rhn_channel;
>
> 	--make rhn_channel be the default creation schema
> 	update pg_settings set setting = 'rhn_channel,' || setting where  
> name = 'search_path';
>
> 	... create a bunch of objects in schema rhn_channel ...
>
> 	-- restore the original setting
> 	update pg_settings set setting = overlay( setting placing '' from 1  
> for (length('rhn_channel')+1) ) where name = 'search_path';
>
> I agree that a nicer way to do that would be good.

Oh, yes please.

>>    alter database foo set search_path = '+bar, baz'; -- append
>>    alter database foo set search_path = 'bar, baz+'; -- prepend
>
> ... but that ain't it :-(.  SET should mean SET, not "do something  
> magic".
> Particularly in ALTER DATABASE/ALTER USER, whose execution order
> relative to other stuff isn't especially well defined.

Perhaps a MODIFY keyword?

Best,

David


In response to

pgsql-hackers by date

Next:From: Dawid KuroczkoDate: 2009-05-27 22:47:06
Subject: Re: search_path vs extensions
Previous:From: David E. WheelerDate: 2009-05-27 22:38:01
Subject: Re: search_path vs extensions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group