Thread: Schemas in a database?

Schemas in a database?

From
Mladen Gogala
Date:
How can I see all the schemas in a Postgres database? There is, of course,
"select distinct schema from pg_tables" but what if the schema contains
no tables? There is no pg_schemas table.

--

Mladen Gogala
Sr. Oracle DBA
1500 Broadway
New York, NY 10036
(212) 329-5251
http://www.vmsinfo.com
The Leader in Integrated Media Intelligence Solutions




Re: Schemas in a database?

From
Vibhor Kumar
Date:
On Aug 5, 2010, at 6:44 PM, Mladen Gogala wrote:

> How can I see all the schemas in a Postgres database? There is, of course,
> "select distinct schema from pg_tables" but what if the schema contains
> no tables? There is no pg_schemas table.

pg_namespace.nspname will give you the information of all schemas in Database

>
> --
> Mladen Gogala Sr. Oracle DBA
> 1500 Broadway
> New York, NY 10036
> (212) 329-5251
> http://www.vmsinfo.com The Leader in Integrated Media Intelligence Solutions
>
>
>
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice

Regards,
Vibhor Kumar

Re: Schemas in a database?

From
Mladen Gogala
Date:
Mladen Gogala wrote:
> How can I see all the schemas in a Postgres database? There is, of course,
> "select distinct schema from pg_tables" but what if the schema contains
> no tables? There is no pg_schemas table.
>
>
And, to answer my own question, the schemas are described in
pg_namespace. Thanks to Tomas Kellerer.

--
Mladen Gogala
Sr. Oracle DBA
1500 Broadway
New York, NY 10036
(212) 329-5251
www.vmsinfo.com