Re: Schema - update search_path

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvin <dartmissile(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Schema - update search_path
Date: 2006-10-11 14:19:47
Message-ID: 22654.1160576387@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvin <dartmissile(at)yahoo(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma Jr 2006-10-11 14:25:49 Re: left outer join on multi tables
Previous Message Tom Lane 2006-10-11 14:12:42 Re: query log corrupted-looking entries