Re: listing databases

From: Louis Bertrand <louis(at)bertrandtech(dot)on(dot)ca>
To: magnus <reduct(at)asa(dot)de>
Cc: "pgsql-php(at)postgresql(dot)org" <pgsql-php(at)postgresql(dot)org>
Subject: Re: listing databases
Date: 2000-11-01 14:54:49
Message-ID: Pine.BSO.4.20.0011010945340.26674-100000@grendel.bts
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Just a quick answer without doing much research.

Have a look at the system tables. There is a switch in psql (can't
remember which one) to monitor the actual sql sent to the back-end.

Start with \dS to list the system tables.

Try SELECT * FROM pg_database; to get the databases

I think template1 always exists, so you can try connecting to that if
you're not sure where to start.

I'm not sure how to get the tables, but I'm sure it's the same process.

Ciao
--Louis <louis(at)bertrandtech(dot)on(dot)ca>

Louis Bertrand http://www.bertrandtech.on.ca/
Bertrand Technical Services, Bowmanville, ON, Canada
Tel: +1.905.623.1500 Fax: +1.905.623.3852

OpenBSD: Secure by default. http://www.openbsd.org/

On Wed, 1 Nov 2000, magnus wrote:

> Hello,
> Can anyone tell me how to list (1.) databases and (2.) tables in a
> database using php?
> Thanks,
> Magnus Lawrie
>

In response to

Browse pgsql-php by date

  From Date Subject
Next Message magnus 2000-11-01 15:02:57 listing databases
Previous Message Adam Lang 2000-11-01 14:46:54 Re: listing databases