Обсуждение: BUG #16195: current_schema always return "public"

Поиск
Список
Период
Сортировка

BUG #16195: current_schema always return "public"

От
PG Bug reporting form
Дата:
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


Re: BUG #16195: current_schema always return "public"

От
Julien Rouhaud
Дата:
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 & 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?



Re: BUG #16195: current_schema always return "public"

От
Michael Paquier
Дата:
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

Вложения