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: da7021e0610160858o1605eed8tf546cfea72994d85@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
Hi,

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();
 current_schema
----------------
 public
(1 row)
db=> show search_path ;
 search_path
--------------
 $user,public
(1 row)

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

(1 row)

db=> show search_path ;
 search_path
-------------
 abc
(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

Charles

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-2014 The PostgreSQL Global Development Group