Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 42DC19FB397 for ; Mon, 16 Oct 2006 12:58:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 54479-08 for ; Mon, 16 Oct 2006 12:58:25 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.183]) by postgresql.org (Postfix) with ESMTP id 319D79FB2AF for ; Mon, 16 Oct 2006 12:58:25 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id d80so2478079pyd for ; Mon, 16 Oct 2006 08:58:22 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=hVfkX9TkWgdBNfspTRePkUd3BwEZEd0o/s7uG0NIbxEUbE67fq9MNPRwRP12ut8x3HgNq1pyO3o2/DUoNLqP8kXcEjefGhEZoOV4pg0nBy2zyEuBU/knjCuAlYUi8C+ZU5COfq4ydkwdwhnzHMQ9bCj3ClGrQG70f7ivkhWNW+4= Received: by 10.35.94.7 with SMTP id w7mr13131568pyl; Mon, 16 Oct 2006 08:58:21 -0700 (PDT) Received: by 10.35.115.8 with HTTP; Mon, 16 Oct 2006 08:58:21 -0700 (PDT) Message-ID: Date: Mon, 16 Oct 2006 17:58:21 +0200 From: Andro To: pgsql-interfaces@postgresql.org Subject: play with current schema MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_65602_23048320.1161014301138" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.405 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/11 X-Sequence-Number: 6294 ------=_Part_65602_23048320.1161014301138 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 ------=_Part_65602_23048320.1161014301138 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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
------=_Part_65602_23048320.1161014301138--