Re: How to list databases with SQL statement?

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Marian D Marinov <hackman(at)hydra(dot)azilian(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to list databases with SQL statement?
Date: 2004-11-23 05:10:05
Message-ID: F04A49AD-3D0D-11D9-89F1-000A95B03262@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Nov 19, 2004, at 7:39 PM, Marian D Marinov wrote:

> Hello,
> Is there a way to list all databases which belong to the current user
> with an
> SQL query?

select datname, usename
from pg_catalog.pg_database, pg_catalog.pg_user
where datdba = usesysid and usename = current_user;

Best,

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ramesh Patel 2004-11-23 05:41:15
Previous Message Michael Fuhr 2004-11-23 04:56:40 Re: How to list databases with SQL statement?