Skip site navigation (1) Skip section navigation (2)

play with current schema

From: Andro <andromede(at)gmail(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: play with current schema
Date: 2006-10-16 15:58:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces

this may not be the right place to address this question but I've already
subscribed on this list.

I'm connected as user "def" and here's what happens while modifying
current_schema - i.e. search_path var :

db=> \dn
       List of schemas
        Name        |  Owner
 abc                | abc
db=> select current_schema();
(1 row)
db=> show search_path ;
(1 row)

db=> SET search_path TO abc;
db=> select current_schema();

(1 row)

db=> show search_path ;
(1 row)

Trying to change the current schema to a _not owned_ schema will _not_ raise
any error and result in this 'misbehaviour' between the two commands showing
the current schema.
select current_schema() will return NULL ...
Did I miss something or everything's normal here?

Isn't it supposed to raise an error or succeed and then the two commands
would display the same?
However, what's the difference between those two commands except that the
latter is a variable and the former will pick up stuff from catalog's table?

Thanks for help


pgsql-interfaces by date

Next:From: Sandeep KhandelwalDate: 2006-10-17 05:36:03
Subject: Re: Bulk Load and Extract from PostgreSQL
Previous:From: Sean DavisDate: 2006-10-16 10:34:45
Subject: Re: Bulk Load and Extract from PostgreSQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group