Re: Unexpected omission of tables with duplicate names across schemas

From: Chris Ross <cross(at)markmonitor(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org, Chris Ross <chris(dot)ross(at)markmonitor(dot)com>
Subject: Re: Unexpected omission of tables with duplicate names across schemas
Date: 2010-09-29 18:08:33
Message-ID: 4CA380A1.4060400@markmonitor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 09/28/2010 01:17 PM, Tom Lane wrote:
> Chris Ross<cross(at)markmonitor(dot)com> writes:
>> 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)
>
> That's the intended behavior, because only the first one is actually
> accessible without schema-qualifying its name. You can use a pattern
> of "*.*" if you want to see objects that are hidden according to the
> search path. The default behavior is equivalent to a pattern of "*",
> which only shows objects reachable with unqualified names.

Okay. However, that doesn't quite do what I want. In the case of
\d, it takes a name, not a pattern, and if a name/pattern is specified
as * or *.*, it shows detail about the item, not just a list.
For \dt, \dv, etc, I can supply a pattern, but *.* does not give me
what I want either. It gives me *all* schemas, not limited to the
schemas that are in my search path.

Is there a way to ask the database "What are all of the
tables/views/etc in my current search path?" without having it infer
"that I can reach without schema-qualifing them" ?

That's what I've always used \d for, and while it's certainly a habit
rather than anything documented explicitly to do what I think it should
do, there needs to be *a* way to do this I think...

- Chris

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Chris Ross 2010-09-29 18:19:52 Re: Unexpected omission of tables with duplicate names across schemas
Previous Message Magnus Hagander 2010-09-29 14:24:03 Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session