psql \dt and identical table names across multiple schemas
От | Murat Tasan |
---|---|
Тема | psql \dt and identical table names across multiple schemas |
Дата | |
Msg-id | 32f5c0fc0807242049g7afb7d62xc8afebdca5089c8f@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: psql \dt and identical table names across multiple schemas
|
Список | pgsql-general |
This may have been brought up before, but if not, I thought I would bring it to attention, as I think this would be an easy fix.
The problem: 2 (or more) schemas that have an identical table name.
From within psql, the \dt (and variants of it) will only show a single version of that table.
example input:
CREATE SCHEMA schema1;
CREATE TABLE schema1.tableX (id integer);
CREATE TABLE schema1.tableY (id integer);
CREATE SCHEMA schema2;
CREATE TABLE schema2.tableX (id integer);
CREATE TABLE schema2.tableZ (id integer);
set search_path to schema1, schema2;
\dt
example output from \dt command:
schema1 | tablex | table | username
schema1 | tabley | table | username
schema2 | tablez | table | username
It seems to me, that if the schemas are even listed in the output of the \dt command, all identically-named tables should be listed.
In fact, showing the schema name but not showing all the tables becomes non-intuitive and somewhat misleading.
Thoughts?
В списке pgsql-general по дате отправления: