pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #14535: SET search_path and list tables
3+ messages / 3 participants
[nested] [flat]
* BUG #14535: SET search_path and list tables
@ 2017-02-08 11:33 totocrenn@gmail.com
0 siblings, 1 reply; 3+ messages in thread
From: totocrenn@gmail.com @ 2017-02-08 11:33 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 14535
Logged by: Thomas Crenn
Email address: totocrenn@gmail.com
PostgreSQL version: 9.6.1
Operating system: Windows
Description:
Hi,
I will explain the bug with an example :
I have 2 SCHEMAS : test and demo
Each schemas have the same TABLE : table
Then I change the search path :
SET search_path TO test, demo;
So when I list all the tables with \dt I should have 2 tables : test.table
and demo.table, but I only see test.table.
After checking, the table demo.table exist but is just not display on the
list.
I guess it's because the query apply a DISTINCT only on the table and not on
the couple (schema , table).
I don't know if it's a bug or if this choice is justified so i have decided
to report you this.
Best regards.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #14535: SET search_path and list tables
@ 2017-02-08 15:03 David G. Johnston <david.g.johnston@gmail.com>
parent: totocrenn@gmail.com
0 siblings, 1 reply; 3+ messages in thread
From: David G. Johnston @ 2017-02-08 15:03 UTC (permalink / raw)
To: totocrenn@gmail.com; +Cc: pgsql-bugs
On Wed, Feb 8, 2017 at 4:33 AM, <totocrenn@gmail.com> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 14535
> Logged by: Thomas Crenn
> Email address: totocrenn@gmail.com
> PostgreSQL version: 9.6.1
> Operating system: Windows
> Description:
>
> Hi,
> I will explain the bug with an example :
>
> I have 2 SCHEMAS : test and demo
> Each schemas have the same TABLE : table
>
> Then I change the search path :
> SET search_path TO test, demo;
>
> So when I list all the tables with \dt I should have 2 tables : test.table
> and demo.table, but I only see test.table.
> After checking, the table demo.table exist but is just not display on the
> list.
>
> I guess it's because the query apply a DISTINCT only on the table and not
> on
> the couple (schema , table).
> I don't know if it's a bug or if this choice is justified so i have decided
> to report you this.
>
It is a choice - \dt, without a object schema specified, will show you the
single object that would be chosen if you have written a query in a
similar fashion:
i.e., SELECT * FROM table;
The table name above can only refer to a single object - chosen based upon
search_path order.
David J.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #14535: SET search_path and list tables
@ 2017-02-08 16:04 Tom Lane <tgl@sss.pgh.pa.us>
parent: David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Tom Lane @ 2017-02-08 16:04 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: pgsql-bugs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Wed, Feb 8, 2017 at 4:33 AM, <totocrenn@gmail.com> wrote:
>> I have 2 SCHEMAS : test and demo
>> Each schemas have the same TABLE : table
>> So when I list all the tables with \dt I should have 2 tables : test.table
>> and demo.table, but I only see test.table.
> It is a choice - \dt, without a object schema specified, will show you the
> single object that would be chosen if you have written a query in a
> similar fashion:
> i.e., SELECT * FROM table;
If you want to see all occurrences of the table name, you can write
something like "\dt *.table". But without any schema component in the
pattern, psql's \d commands will only show objects that are visible in
the search path --- which means "they could be referenced by unqualified
names", not "their schema is in the search path someplace".
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2017-02-08 16:04 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-02-08 11:33 BUG #14535: SET search_path and list tables totocrenn@gmail.com
2017-02-08 15:03 ` David G. Johnston <david.g.johnston@gmail.com>
2017-02-08 16:04 ` Tom Lane <tgl@sss.pgh.pa.us>
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