Skip site navigation (1) Skip section navigation (2)

Unexpected omission of tables with duplicate names across schemas

From: Chris Ross <cross(at)markmonitor(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Cc: Chris Ross <chris(dot)ross(at)markmonitor(dot)com>
Subject: Unexpected omission of tables with duplicate names across schemas
Date: 2010-09-28 16:58:15
Message-ID: 4CA21EA7.4000201@markmonitor.com (view raw or flat)
Thread:
Lists: pgsql-bugs
   When there is a table (or view, or sequence) of the same name in one 
schema as another, and both of these schemas are in the set search_path, 
only the first schema in the search path will show that name in the 
output of \d[S+].  (Also \dt, \dv, etc)

PostgreSQL versions:  8.2.x, 8.3.x, 8.4.4, 9.0.0
Operating System: Linux (Ubuntu 10 and RedHat EL5 tested)

   Running the attached file to create tables in schemas, then running 
the below commands show output as noted.  At the bottom, I have also 
simulated what I expect the output to be.

   I *think* this is a bug.  I did not expect filtration to occur with 
table/view names in the output of a simple "\d".  This also seems to 
prevent display of any tables where a table of the same name exists in 
the pg_catalog schema.

   Thank you.  Please let me know if this is a known issue, or if 
there's anything I can do to help describe the problem.

                                                            - Chris


% \i pgsql9.bugshow-database.sql
% \d
            List of relations
  Schema |     Name     | Type  | Owner
--------+--------------+-------+-------
  test2  | test_table   | table | cross
  test2  | test_table_2 | table | cross
(2 rows)

% set search_path to test1,test2;
% \d

Output:

            List of relations
  Schema |     Name     | Type  | Owner
--------+--------------+-------+-------
  test1  | test_table   | table | cross
  test1  | test_table_1 | table | cross
  test2  | test_table_2 | table | cross
(3 rows)

Expected Output:

            List of relations
  Schema |     Name     | Type  | Owner
--------+--------------+-------+-------
  test1  | test_table   | table | cross
  test1  | test_table_1 | table | cross
  test2  | test_table   | table | cross
  test2  | test_table_2 | table | cross
(4 rows)


Attachment: pgsql9.bugshow-database.sql
Description: text/plain (2.6 KB)

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2010-09-28 17:17:56
Subject: Re: Unexpected omission of tables with duplicate names across schemas
Previous:From: Tom LaneDate: 2010-09-28 14:19:46
Subject: Re: BUG #5680: Failure to start: too many private dirs demanded

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group