Listing schemas

Started by Francisco Reyesabout 23 years ago3 messagesgeneral
Jump to latest
#1Francisco Reyes
lists@natserv.com

I don't see a way to list schemas in a database other than
select distinct schemaname from pg_tables;

Did I miss something? I was expecting to find something along the lines of
the \d functions in pgsql.

#2Ian Lawrence Barwick
barwick@gmail.com
In reply to: Francisco Reyes (#1)
Re: Listing schemas

On Saturday 01 March 2003 00:14, Francisco Reyes wrote:

I don't see a way to list schemas in a database other than
select distinct schemaname from pg_tables;

SELECT nspname FROM pg_catalog.pg_namespace

should be a better choice.

Did I miss something? I was expecting to find something along the lines of
the \d functions in pgsql.

Which version of psql are you using? There is a \dn to list
schemas in current CVS, and possibly 7.3.2 (but not 7.3.1 or
earlier). Whatever, it's on the way.

Ian Barwick
barwick@gmx.net

#3Bruno Wolff III
bruno@wolff.to
In reply to: Francisco Reyes (#1)
Re: Listing schemas

On Fri, Feb 28, 2003 at 18:14:56 -0500,
Francisco Reyes <lists@natserv.com> wrote:

I don't see a way to list schemas in a database other than
select distinct schemaname from pg_tables;

Did I miss something? I was expecting to find something along the lines of
the \d functions in pgsql.

There is a way to do this in 7.4. For 7.3 you need to use a select.