search_path and current_schema

From: Jayadevan M <maymala(dot)jayadevan(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: search_path and current_schema
Date: 2013-10-27 16:19:18
Message-ID: CAFS1N4jbpZnuywZaxZs0mbtYp1hqCoZag2LLH4Xz=JDCc1NjWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I was trying out schema settings and related functions. PostgreSQL version
is 9.3

[postgres(at)MyCentOS 9.3]$ psql
psql (9.3.0)
Type "help" for help.

postgres=# show search_path;
search_path
----------------
"$user",public
(1 row)

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

postgres=# set search_path=mynewschema, "$user", public;
SET
postgres=# select current_schemas(true);
current_schemas
---------------------
{pg_catalog,public}
(1 row)

postgres=# show search_path;
search_path
------------------------------
mynewschema, "$user", public
(1 row)

I thought current_schemas and search_path will return the same set of
schemas (except that current_schema will show pg_catalog also, if we use
true). Shouldn't mynewschema appear in the output of select
current_schemas(true)?

Regards,
Jayadevan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2013-10-27 16:25:06 Re: search_path and current_schema
Previous Message Rowan Collins 2013-10-27 14:45:05 Re: Unique - first