Re: get list of databases and tables in Postgres

Lists: pgsql-php
From: Wim Paulussen <wim(at)chen(dot)be>
To: pgsql-php(at)postgresql(dot)org
Subject: get list of databases and tables in Postgres
Date: 2004-03-01 11:00:57
Message-ID: 404317E9.2050004@chen.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

LS,

Hope you can help : I am looking for equivalent sql statement for the
following in MySQL :
SHOW DATABASES

I found out that for the tables you can connect to a Postgresql specific
table information_schema.tables , but what is the corresponding table
for the names of databases under Postgresql ?

All help is highly appreciated.


From: "Majolee InfoTech" <info(at)majolee(dot)info>
To: "Wim Paulussen" <wim(at)chen(dot)be>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: get list of databases and tables in Postgres
Date: 2004-03-01 11:41:06
Message-ID: 000c01c3ff82$1aa1d270$0100a8c0@MAJOLEE1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

Use:

select datname from pg_database;

===============
Mihir & Biren
Partners
Majolee InfoTech
===============
----- Original Message -----
From: "Wim Paulussen" <wim(at)chen(dot)be>
To: <pgsql-php(at)postgresql(dot)org>
Sent: Monday, March 01, 2004 4:30 PM
Subject: [PHP] get list of databases and tables in Postgres

> LS,
>
> Hope you can help : I am looking for equivalent sql statement for the
> following in MySQL :
> SHOW DATABASES
>
> I found out that for the tables you can connect to a Postgresql specific
> table information_schema.tables , but what is the corresponding table
> for the names of databases under Postgresql ?
>
> All help is highly appreciated.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match
>
>


From: "Chris Boget" <chris(at)wild(dot)net>
To: "Majolee InfoTech" <info(at)majolee(dot)info>, "Wim Paulussen" <wim(at)chen(dot)be>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: get list of databases and tables in Postgres
Date: 2004-03-01 14:29:28
Message-ID: 007801c3ff99$b29452d0$8c01a8c0@entropy
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

> select datname from pg_database;

Or simply:

\d

unless I'm missing something...

Chris


From: "D(dot) Wokan" <wokan(at)cox(dot)net>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: get list of databases and tables in Postgres
Date: 2004-03-01 20:58:21
Message-ID: 4043A3ED.3080102@cox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

Chris Boget wrote:

>>select datname from pg_database;
> Or simply:
> \d
> unless I'm missing something...
> Chris

Would PGSQL respond to that as a query?
--
D. Wokan


From: Ângelo Marcos Rigo <angelo_rigo(at)yahoo(dot)com(dot)br>
To: Majolee InfoTech <info(at)majolee(dot)info>, Wim Paulussen <wim(at)chen(dot)be>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: get list of databases and tables in Postgres
Date: 2004-03-01 21:10:46
Message-ID: 20040301211046.48515.qmail@web14803.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

using psql
psql -l

=====
Ângelo Marcos Rigo
AMR Informática
(51) 3348 0870
Rua Pe. Alois Kades 400/210
Porto Alegre /RS/Brasil
http://amr.freezope.org
angelo_rigo(at)yahoo(dot)com(dot)br

______________________________________________________________________

Yahoo! Mail - O melhor e-mail do Brasil! Abra sua conta agora:
http://br.yahoo.com/info/mail.html


From: "Chris Smith" <chris(at)interspire(dot)com>
To: "'Chris Boget'" <chris(at)wild(dot)net>, "'Majolee InfoTech'" <info(at)majolee(dot)info>, "'Wim Paulussen'" <wim(at)chen(dot)be>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: get list of databases and tables in Postgres
Date: 2004-03-01 22:30:49
Message-ID: 000701c3ffdc$dfb169e0$0d00a8c0@chris
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

He wants to do it through PHP - so I don't think this will work.

You could always

psql -E -l

BUT - that query *could* change depending on the version of postgresql
you're running.

Chris.

-----Original Message-----
From: pgsql-php-owner(at)postgresql(dot)org
[mailto:pgsql-php-owner(at)postgresql(dot)org] On Behalf Of Chris Boget
Sent: Tuesday, March 02, 2004 1:29 AM
To: Majolee InfoTech; Wim Paulussen
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: [PHP] get list of databases and tables in Postgres

> select datname from pg_database;

Or simply:

\d

unless I'm missing something...

Chris

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Chris Smith <chris(at)interspire(dot)com>
Cc: "'Chris Boget'" <chris(at)wild(dot)net>, "'Majolee InfoTech'" <info(at)majolee(dot)info>, "'Wim Paulussen'" <wim(at)chen(dot)be>, <pgsql-php(at)postgresql(dot)org>
Subject: Re: get list of databases and tables in Postgres
Date: 2004-03-01 22:31:17
Message-ID: Pine.LNX.4.33.0403011530580.1074-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

If you're running 7.4, look into the iformation_schema for such things.
That likely won't change.

On Tue, 2 Mar 2004, Chris Smith wrote:

> He wants to do it through PHP - so I don't think this will work.
>
> You could always
>
> psql -E -l
>
> BUT - that query *could* change depending on the version of postgresql
> you're running.
>
> Chris.
>
> -----Original Message-----
> From: pgsql-php-owner(at)postgresql(dot)org
> [mailto:pgsql-php-owner(at)postgresql(dot)org] On Behalf Of Chris Boget
> Sent: Tuesday, March 02, 2004 1:29 AM
> To: Majolee InfoTech; Wim Paulussen
> Cc: pgsql-php(at)postgresql(dot)org
> Subject: Re: [PHP] get list of databases and tables in Postgres
>
>
> > select datname from pg_database;
>
> Or simply:
>
> \d
>
> unless I'm missing something...
>
> Chris
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>