pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
List tables for a specific schema
3+ messages / 3 participants
[nested] [flat]

* List tables for a specific schema
@ 2019-06-20 21:43 David Gauthier <davegauthierpg@gmail.com>
  2019-06-20 21:50 ` Re: List tables for a specific schema Adrian Klaver <adrian.klaver@aklaver.com>
  2019-06-20 22:06 ` Re: List tables for a specific schema Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 3+ messages in thread

From: David Gauthier @ 2019-06-20 21:43 UTC (permalink / raw)
  To: pgsql-general

psql (9.6.7, server 9.5.2)

I created a schema in my DB called "dvm".  Then I created a table a-la...
create table dvm.foo (col1 tedxt); .  I see the schema with \dnS+.  But I
can't see my table using \d.  I can see the dable with \d dvm.foo, so it's
in there.  The first column of the \d output is "Schema", so I would have
expected to see it there. But no luck.

What I would like is to see a list of all the tables in the dvm schema and
nothing else.  "\d dvm.*" works, but it also spills the details of every
table.  I just want the list of tables in the schema.

Is there a way to get what I want ?

Thanks !

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: List tables for a specific schema
  2019-06-20 21:43 List tables for a specific schema David Gauthier <davegauthierpg@gmail.com>
@ 2019-06-20 21:50 ` Adrian Klaver <adrian.klaver@aklaver.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Adrian Klaver @ 2019-06-20 21:50 UTC (permalink / raw)
  To: David Gauthier <davegauthierpg@gmail.com>; pgsql-general

On 6/20/19 2:43 PM, David Gauthier wrote:
> psql (9.6.7, server 9.5.2)
> 
> I created a schema in my DB called "dvm".  Then I created a table a-la...
> create table dvm.foo (col1 tedxt); .  I see the schema with \dnS+.  But 
> I can't see my table using \d.  I can see the dable with \d dvm.foo, so 
> it's in there.  The first column of the \d output is "Schema", so I 
> would have expected to see it there. But no luck.
> 
> What I would like is to see a list of all the tables in the dvm schema 
> and nothing else.  "\d dvm.*" works, but it also spills the details of 
> every table.  I just want the list of tables in the schema.
> 
> Is there a way to get what I want ?

Looks like a search_path issue.

In psql:

1) show search_path
To see what your search path is.

2) Then take a look at:
https://www.postgresql.org/docs/11/ddl-schemas.html#DDL-SCHEMAS-PATH

to see how to change it.

> 
> Thanks !


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: List tables for a specific schema
  2019-06-20 21:43 List tables for a specific schema David Gauthier <davegauthierpg@gmail.com>
@ 2019-06-20 22:06 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2019-06-20 22:06 UTC (permalink / raw)
  To: David Gauthier <davegauthierpg@gmail.com>; +Cc: pgsql-general

David Gauthier <davegauthierpg@gmail.com> writes:
> What I would like is to see a list of all the tables in the dvm schema and
> nothing else.  "\d dvm.*" works, but it also spills the details of every
> table.  I just want the list of tables in the schema.

Try "\dt dvm.*".

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2019-06-20 22:06 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-06-20 21:43 List tables for a specific schema David Gauthier <davegauthierpg@gmail.com>
2019-06-20 21:50 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-06-20 22:06 ` Tom Lane <tgl@sss.pgh.pa.us>

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