Re: Quoting $user as Parameter to SET

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Thomas F(dot) O'Connell" <tfo(at)sitening(dot)com>
Cc: PgSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Quoting $user as Parameter to SET
Date: 2005-07-11 23:04:40
Message-ID: 12751.1121123080@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Thomas F. O'Connell" <tfo(at)sitening(dot)com> writes:
> 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.

Really? It works fine for me:

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

regression=# select current_schemas(true);
current_schemas
------------------------------
{pg_catalog,postgres,public}
(1 row)

regression=# alter database regression set search_path = public, '$user';
ALTER DATABASE
regression=# \c -
You are now connected to database "regression".
regression=# show search_path;
search_path
-----------------
public, "$user"
(1 row)

regression=# select current_schemas(true);
current_schemas
------------------------------
{pg_catalog,public,postgres}
(1 row)

regression=#

regards, tom lane

In response to

Responses

Browse pgsql-general by date

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