SET search_path = value - Mailing list pgadmin-hackers

From Erwin Brandstetter
Subject SET search_path = value
Date
Msg-id 4BCBC36A.9000706@falter.at
Whole thread Raw
Responses Re: SET search_path = value  (Guillaume Lelarge <guillaume@lelarge.info>)
List pgadmin-hackers
Hi developers!

Just created a ticket concerning a minor error in the reverse engineered
SQL code for roles

Besides the example ...
     ALTER ROLE SET search_path = test, public;
--> ALTER DATABASE test SET search_path='test, public';    -- quotes are
wrong
... there are at least two more occurrances:
     ALTER FUNCTION ...
     ALTER DATABASE ...

_If_ you wanted to quote the schema names, it would have to be quotes
around _each_ schema in the list, like so:
     ALTER DATABASE test SET search_path = 'test', 'public';
But that would lead to another pitfall. This does not work as intended:
     ALTER DATABASE test SET search_path = '"$user", public';
So, best not to add single quotes at all:
     ALTER DATABASE test SET search_path ="$user", public;

The official docs on the matter are also misleading, IMO.
http://www.postgresql.org/docs/8.4/interactive/runtime-config-client.html
I've sent a comment on the website.

Regards
Erwin

pgadmin-hackers by date:

Previous
From: "pgAdmin Trac"
Date:
Subject: Re: [pgAdmin III] #169: SET search_path = value
Next
From: Dave Page
Date:
Subject: Re: Ticket 3: groups of servers