Quoting $user as Parameter to SET

From: "Thomas F(dot) O'Connell" <tfo(at)sitening(dot)com>
To: PgSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Quoting $user as Parameter to SET
Date: 2005-07-11 22:16:12
Message-ID: 98D22CE5-7EE4-4EEA-831D-B7DDC13EAB42@sitening.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The default search_path is $user, public.

Say I wanted to reverse this in a database called d:

First of all:

d=> show search_path;
search_path
--------------
$user,public
(1 row)

Then:

d=> alter database d set search_path to public, '$user';

Then, in a new session:

d=> show search_path;
search_path
-----------------
public, "$user"
(1 row)

This is an important distinction because testing reveals that the
quoted $user after the reversal is no longer actually a dynamic
variable that results in a search_path that resolves to the current
user.

I'm having trouble locating an example of how to include a variable
in the parameter list to SET.

--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC

Strategic Open Source: Open Your i™

http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-260-0005

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-07-11 22:55:14 Re: table locking and SELECT FOR UPDATE
Previous Message Joseph Shraibman 2005-07-11 22:10:23 table locking and SELECT FOR UPDATE