Re: describe working as intended?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: describe working as intended?
Date: 2019-05-18 01:27:24
Message-ID: 25289.1558142844@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Melanie Plageman <melanieplageman(at)gmail(dot)com> writes:
> So, I noticed that if I make a table in one schema and then a table with the
> same name in another schema that describe only shows me one of them.

Yes, that's intended, psql's \d will only show you tables that are
visible in the search path, unless you give it a qualified pattern.
You can do something like "\d *.t1" if you want to see all the
instances of t1.

This is documented I believe ... ah yes, here:

Whenever the pattern parameter is omitted completely, the \d commands
display all objects that are visible in the current schema search path
— this is equivalent to using * as the pattern. (An object is said to
be visible if its containing schema is in the search path and no
object of the same kind and name appears earlier in the search
path. This is equivalent to the statement that the object can be
referenced by name without explicit schema qualification.) To see all
objects in the database regardless of visibility, use *.* as the
pattern.
...
A pattern that contains a dot (.) is interpreted as a schema name
pattern followed by an object name pattern. For example, \dt
foo*.*bar* displays all tables whose table name includes bar that are
in schemas whose schema name starts with foo. When no dot appears,
then the pattern matches only objects that are visible in the current
schema search path. Again, a dot within double quotes loses its
special meaning and is matched literally.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-05-18 01:30:07 Re: Passing CopyMultiInsertInfo structure to CopyMultiInsertInfoNextFreeSlot()
Previous Message Tom Lane 2019-05-18 01:18:16 Re: New vacuum option to do only freezing