pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: francois@teksol.info
To: pgsql-bugs@postgresql.org
Subject: BUG #14578: Tables with same name in different schema are not shown with \dt
Date: Sat, 04 Mar 2017 14:51:44 +0000
Message-ID: <20170304145144.25052.11799@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      14578
Logged by:          François Beausoleil
Email address:      francois@teksol.info
PostgreSQL version: 9.6.2
Operating system:   Mac OS 10.11.6
Description:        

In my schema, I happen to have two tables in different schemas with the same
name. PG supports that no problem, but when I listed the tables using \dt
and the search path set to both schemas, I expected to see the two tables.
Sadly, that wasn't the case.

https://gist.github.com/francois/2db220bd197492d02e0b60224a7576ac

-- repro.sql
create schema mybank;
create table public.a();
create table mybank.a();
set search_path to public;
\dt
set search_path to mybank;
\dt
set search_path to mybank, public;
\dt
set search_path to public, mybank;
\dt


-- run
$ psql --no-psqlrc --quiet repro -f b.sql
        List of relations
 Schema | Name | Type  |  Owner
--------+------+-------+----------
 public | a    | table | francois
(1 row)

        List of relations
 Schema | Name | Type  |  Owner
--------+------+-------+----------
 mybank | a    | table | francois
(1 row)

        List of relations
 Schema | Name | Type  |  Owner
--------+------+-------+----------
 mybank | a    | table | francois
(1 row)

        List of relations
 Schema | Name | Type  |  Owner
--------+------+-------+----------
 public | a    | table | francois
(1 row)


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


view thread (5+ messages)  latest in thread

Message-ID: <20170304145144.25052.11799@wrigleys.postgresql.org>
Permalink:  ../20170304145144.25052.11799@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20170304145144.25052.11799@wrigleys.postgresql.org

 · 

reply

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: francois@teksol.info
  Subject: Re: BUG #14578: Tables with same name in different schema are not shown with \dt
  In-Reply-To: <20170304145144.25052.11799@wrigleys.postgresql.org>
  References: <20170304145144.25052.11799@wrigleys.postgresql.org>

* 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