Re: How to list all schema names inside a PostgreSQL database through SQL

From: Ondrej Ivanič <ondrej(dot)ivanic(at)gmail(dot)com>
To: Xiaobo Gu <guxiaobo1982(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to list all schema names inside a PostgreSQL database through SQL
Date: 2012-11-15 21:33:20
Message-ID: CAM6mie+ZbkUgqWTA1nPfuvcYE0918UmtBdrrL8sxiYH9BaQQDw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

On 15 November 2012 23:31, Xiaobo Gu <guxiaobo1982(at)gmail(dot)com> wrote:
> How can I list all schema names inside a PostgreSQL database through
> SQL, especially thoese without any objects created inside it.

Use -E psql's option:
-E, --echo-hidden display queries that internal commands generate

then you get SQL query for each internal command.

The second option is to use information_schema.schemata view (this is
works across databases)

--
Ondrej Ivanic
(http://www.linkedin.com/in/ondrejivanic)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2012-11-15 21:49:42 Re: High SYS CPU - need advise
Previous Message Vlad 2012-11-15 20:44:23 Re: High SYS CPU - need advise