On Wed, Aug 6, 2014 at 12:12:29AM -0300, Fabrízio de Royes Mello wrote:
>
> On Tue, Aug 5, 2014 at 10:55 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Josh Berkus <josh@agliodbs.com> writes:
> > BTW, while there's unlikely to be a good reason to put search_path in
> > pg.conf with appends, there are a LOT of reasons to want to be able to
> > append to it during a session.
>
> [shrug...] You can do that today with current_setting()/set_config().
>
>
>
> +1
>
> With a very simple statement you can do that:
>
> fabrizio=# SELECT current_setting('search_path');
> current_setting
> -----------------
> "$user",public
> (1 row)
>
> fabrizio=# SELECT set_config('search_path', current_setting('search_path')||',
> another_schema', false);
> set_config
> --------------------------------
> "$user",public, another_schema
> (1 row)
Yes, that is very nice, but it only works for session-level changes,
i.e. you can't use that in postgresql.conf or via ALTER USER/DATABASE.
-- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB
http://enterprisedb.com
+ Everyone has their own god. +