pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: magnus <reduct@asa.de>
To: Tod McQuillin <devin@spamcop.net>
Cc: pgsql-php@postgresql.org <pgsql-php@postgresql.org>
Subject: Re: listing databases
Date: Wed, 01 Nov 2000 22:06:03 +0100
Message-ID: <3A0085BB.73E698CA@asa.de> (raw)
References: <Pine.GSO.4.21.0011011008290.6485-100000@sysadmin>

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@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"
> *************************



view thread (12+ messages)

Message-ID: <3A0085BB.73E698CA@asa.de>
Permalink:  ../3A0085BB.73E698CA@asa.de/
Also on:    postgresql.org/message-id/3A0085BB.73E698CA@asa.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: reduct@asa.de, devin@spamcop.net
  Subject: Re: listing databases
  In-Reply-To: <3A0085BB.73E698CA@asa.de>
  References: <Pine.GSO.4.21.0011011008290.6485-100000@sysadmin> <3A0085BB.73E698CA@asa.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox