psql doesn't show tables duplicated in multiple schemas
От | Wojciech Strzalka |
---|---|
Тема | psql doesn't show tables duplicated in multiple schemas |
Дата | |
Msg-id | CAJf-CGso9C6KJYSrj5N8eesyKR1iXiLm51aaiLHn19Ngpxsv6A@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: psql doesn't show tables duplicated in multiple schemas
Re: psql doesn't show tables duplicated in multiple schemas |
Список | pgsql-bugs |
Setup
----------------------
CREATE SCHEMA x;
CREATE SCHEMA y;
CREATE SCHEMA y;
CREATE TABLE x.a(f int4);
CREATE TABLE x.b(f int4);
CREATE TABLE x.b(f int4);
CREATE TABLE y.b(f int4);
CREATE TABLE y.c(f int4);
-----------------------
Test
-----------------------
docker=# set search_path=x;
SET
docker=# \d
List of relations
Schema | Name | Type | Owner
--------+------+-------+--------
x | a | table | docker
x | b | table | docker
(2 rows)
docker=# set search_path=y;
SET
docker=# \d
List of relations
Schema | Name | Type | Owner
--------+------+-------+--------
y | b | table | docker
y | c | table | docker
(2 rows)
docker=# set search_path=x,y;
SET
docker=# \d
List of relations
Schema | Name | Type | Owner
--------+------+-------+--------
x | a | table | docker
x | b | table | docker
y | c | table | docker
(3 rows)
SET
docker=# \d
List of relations
Schema | Name | Type | Owner
--------+------+-------+--------
x | a | table | docker
x | b | table | docker
(2 rows)
docker=# set search_path=y;
SET
docker=# \d
List of relations
Schema | Name | Type | Owner
--------+------+-------+--------
y | b | table | docker
y | c | table | docker
(2 rows)
docker=# set search_path=x,y;
SET
docker=# \d
List of relations
Schema | Name | Type | Owner
--------+------+-------+--------
x | a | table | docker
x | b | table | docker
y | c | table | docker
(3 rows)
-----------------------
I would expect last table listing to include 'y.b' table. Although shadowed when referencing by 'b' it's still there.
Tested with psql & postgres 13.3
В списке pgsql-bugs по дате отправления: