Re: listing databases

From: magnus <reduct(at)asa(dot)de>
To: Tod McQuillin <devin(at)spamcop(dot)net>
Cc: "pgsql-php(at)postgresql(dot)org" <pgsql-php(at)postgresql(dot)org>
Subject: Re: listing databases
Date: 2000-11-01 21:06:03
Message-ID: 3A0085BB.73E698CA@asa.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Thankyou, that seems to work fine, although I found I had to uncomment
everything inside my sql query quotes:

$sql= "SELECT pg_database.datname as Database,
pg_user.usename as Owner FROM pg_database, pg_user
WHERE pg_database.datdba = pg_user.usesysid";

Magnus Lawrie

Tod McQuillin wrote:

> Sorry, I didn't notice that you wanted to do it from php. Even so, the
> answer is almost the same.
>
> If you run "psql -E -l" you get this:
>
> devin(at)glass ~% psql -E -l
> ********* QUERY *********
> SELECT pg_database.datname as "Database",
> pg_user.usename as "Owner"FROM pg_database, pg_user
> WHERE pg_database.datdba = pg_user.usesysid
>
> UNION
>
> SELECT pg_database.datname as "Database",
> NULL as "Owner"FROM pg_database
> WHERE pg_database.datdba NOT IN (SELECT usesysid FROM pg_user)
> ORDER BY "Database"
> *************************

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Stephen van Egmond 2000-11-06 14:51:51 Re: Select count
Previous Message Tony Dunn 2000-11-01 17:50:54 RE: listing databases