Re: Schema - update search_path - Mailing list pgsql-general

From Tom Lane
Subject Re: Schema - update search_path
Date
Msg-id 22654.1160576387@sss.pgh.pa.us
Whole thread Raw
In response to Schema - update search_path  (Alvin <dartmissile@yahoo.com>)
List pgsql-general
Alvin <dartmissile@yahoo.com> writes:
> Hey guys, I would like to know a good way of updating or appending th=
> e schema names in the search path,

Perhaps like this:

regression=# create schema news;
CREATE SCHEMA
regression=# show search_path;
  search_path
----------------
 "$user",public
(1 row)

regression=# select set_config('search_path', current_setting('search_path') || ',' || quote_ident('news'), false);
     set_config
---------------------
 "$user",public,news
(1 row)

regression=# show search_path;
     search_path
---------------------
 "$user",public,news
(1 row)

regression=#

You should read these two pages for several useful functions:
http://www.postgresql.org/docs/8.1/static/functions-info.html
http://www.postgresql.org/docs/8.1/static/functions-admin.html

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: query log corrupted-looking entries
Next
From: Richard Broersma Jr
Date:
Subject: Re: left outer join on multi tables