From: John R Pierce <pierce@hogranch.com>
To: lucian.ciufudean@gmail.com
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #14317: psql \dt not working as expected
Date: Thu, 8 Sep 2016 08:46:42 -0700
Message-ID: <c3f3e43b-c84d-2c53-dfb5-1e9974831e1b@hogranch.com> (raw)
In-Reply-To: <20160908154003.1410.72854@wrigleys.postgresql.org>
References: <20160908154003.1410.72854@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: pierce@hogranch.com, lucian.ciufudean@gmail.com
Subject: Re: BUG #14317: psql \dt not working as expected
In-Reply-To: <c3f3e43b-c84d-2c53-dfb5-1e9974831e1b@hogranch.com>
References: <20160908154003.1410.72854@wrigleys.postgresql.org> <c3f3e43b-c84d-2c53-dfb5-1e9974831e1b@hogranch.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox