Re: BUG #14317: psql \dt not working as expected

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: BUG #14317: psql \dt not working as expected
Дата
Msg-id c3f3e43b-c84d-2c53-dfb5-1e9974831e1b@hogranch.com
обсуждение исходный текст
Ответ на BUG #14317: psql \dt not working as expected  (lucian.ciufudean@gmail.com)
Список pgsql-bugs
On 9/8/2016 8:40 AM, lucian.ciufudean@gmail.com wrote:
> If one creates a table with the same name as one of the pg_catalog tables
>
> 1. CREATE TABLE pg_tables (
>      name            varchar(80),
>      location        point
> );
>
> then \dt will not show it:
>
>           List of relations
>   Schema |  Name  | Type  |  Owner
> --------+--------+-------+----------
>   public | cities | table | postgres
> (1 row)
>
> while this query will:
>
> select * from pg_tables;
>
> Expectations: \dt shows all tables in the public schema.
>
> Note that it is also unexpected that this query:
>
> select * from pg_tables;
>
> goes to pg_catalog.pg_tables instead of public.pg_tables.

this is because pg_catalog is implicitly in the search path in front of
any explicit search path you specify, including the default of
`$user,public` ...

suggestion:  don't use names like pg_XXXXX for anything.


--
john r pierce, recycling bits in santa cruz

В списке pgsql-bugs по дате отправления:

Предыдущее
От: lucian.ciufudean@gmail.com
Дата:
Сообщение: BUG #14317: psql \dt not working as expected
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #14317: psql \dt not working as expected