BUG #16195: current_schema always return "public"

Started by PG Bug reporting formover 6 years ago3 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following bug has been logged on the website:

Bug reference: 16195
Logged by: Boris Kalimira
Email address: kalimira.boris@gmail.com
PostgreSQL version: 12.1
Operating system: CentOS 7 & Windows
Description:

Context:
user "test" and schema "test" created on my DB.

Connencted as test user on my DB:
SHOW search_path -> "$user", public
SELECT current_schema -> public

Expectation -> SELECT current_schema -> test

#2Julien Rouhaud
rjuju123@gmail.com
In reply to: PG Bug reporting form (#1)
Re: BUG #16195: current_schema always return "public"

On Tue, Jan 7, 2020 at 5:07 PM PG Bug reporting form
<noreply@postgresql.org> wrote:

The following bug has been logged on the website:

Bug reference: 16195
Logged by: Boris Kalimira
Email address: kalimira.boris@gmail.com
PostgreSQL version: 12.1
Operating system: CentOS 7 &amp; Windows
Description:

Context:
user "test" and schema "test" created on my DB.

Connencted as test user on my DB:
SHOW search_path -> "$user", public
SELECT current_schema -> public

Expectation -> SELECT current_schema -> test

Is "test" role owner of the "test" schema, or does it have usage
privilege on it?

#3Michael Paquier
michael@paquier.xyz
In reply to: PG Bug reporting form (#1)
Re: BUG #16195: current_schema always return "public"

On Tue, Jan 07, 2020 at 04:06:05PM +0000, PG Bug reporting form wrote:

Context:
user "test" and schema "test" created on my DB.

Connencted as test user on my DB:
SHOW search_path -> "$user", public
SELECT current_schema -> public

Expectation -> SELECT current_schema -> test

With a database role named test:
=# show search_path ;
search_path
-----------------
"$user", public
(1 row)
=# select current_schema();
current_schema
----------------
public
(1 row)
=# create schema test;
CREATE SCHEMA
=# select current_schema();
current_schema
----------------
test
(1 row)

So your expectation is right, but not your test.
--
Michael