Re: append to the current search_path

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "TJ O'Donnell" <tjo(at)acm(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: append to the current search_path
Date: 2005-08-13 02:36:52
Message-ID: 20050813023652.GA33113@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Aug 12, 2005 at 06:30:59PM -0700, TJ O'Donnell wrote:
> How can I append to the current search_path?
> How can I put $user (back) into the search path?
> These commands all fail:
> set search_path $user,public,gnova;
> set search_path \$user,public,gnova;
> set search_path '$user',public,gnova;

The last one should succeed if you add "TO" or "=" as the SET
documentation shows.

http://www.postgresql.org/docs/8.0/static/sql-set.html

> Ideally, I would like something like PATH=${PATH}:/usr/local/bin
> where I can get the current value and just append to it.

You could use the set_config() and current_setting() functions.

http://www.postgresql.org/docs/8.0/static/functions-admin.html

I'm not aware of a way to append to a variable's current setting
with SET, but I'd be happy to be corrected.

--
Michael Fuhr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John DeSoi 2005-08-13 11:15:54 Re: Seeking PL/PGSQL example
Previous Message TJ O'Donnell 2005-08-13 01:30:59 append to the current search_path