From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: John Scalia <jayknowsunix@gmail.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: behavior of \dt and schemas
Date: Fri, 20 Jan 2017 10:37:35 -0500
Message-ID: <10797.1484926655@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwZvAf3GH+aaQX4WmLr=8hz0-tVRcbcPsp=p3Vedyx-fZg@mail.gmail.com>
References: <CABzCKRAoMHjwr__4Y6tEmF8HAm2yZhEgPVqwg8=Y8_1-cfDjsg@mail.gmail.com>
<CAKFQuwZvAf3GH+aaQX4WmLr=8hz0-tVRcbcPsp=p3Vedyx-fZg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Friday, January 20, 2017, John Scalia <jayknowsunix@gmail.com> wrote:
>> So, to me this is somewhat non-intuitive behavior, but maybe I'm all wet
>> here. Shouldn't \dt report all the tables it can see with the search_path
>> set to some value? And btw, this is was the behavior on 9.4.10, so if it's
>> changed in more recent versions, I haven't tested there yet.
> It shows the definition of the table you would be referencing if you used
> that name in a query. This seems like a useful behavior.
Right --- according to our normal terminology, b.mytable is *not* visible,
because it is masked by a.mytable being ahead of it in the search path.
You'd have to write a qualified name to get at b.mytable.
You can write, eg, "\dt *.mytable" or "\dt *.*" if you would like it to
show tables that are not visible according to this rule. Without a
dot in the pattern, \dt shows only visible tables, ie only the ones
you could name without putting a dot in the name.
regards, tom lane
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, jayknowsunix@gmail.com
Subject: Re: behavior of \dt and schemas
In-Reply-To: <10797.1484926655@sss.pgh.pa.us>
* 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