[development] Postgres equivalent to SHOW TABLES

Nancy Wichmann nan_wich at bellsouth.net
Fri Sep 4 22:50:18 UTC 2009


Ivan Sergio Borgonovo wrote:
> So you connect to postgresql through psql -E

I guess I haven't been clear. I am writing a module and want it to be able
to support both MySql and Postgres. This will be in the code. I don't have
Postgres.

Nancy E. Wichmann, PMP
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King,
Jr.


-----Original Message-----
From: development-bounces at drupal.org
[mailto:development-bounces at drupal.org]On Behalf Of Ivan Sergio
Borgonovo
Sent: Friday, September 04, 2009 4:42 PM
To: development at drupal.org
Subject: Re: [development] Postgres equivalent to SHOW TABLES


On Fri, 4 Sep 2009 15:56:41 -0400
"Nancy Wichmann" <nan_wich at bellsouth.net> wrote:

> Ivan Sergio Borgonovo wrote:
> > start psql with -E param ...
>
> This is in a module, so I cannot demand that the user start it any
> way other than how it would be started for Drupal.

That's just to learn how to get the information with SQL.

So you connect to postgresql through psql -E
use \d stuff
get the SQL used by psql to get the info and copy and paste it in
your drupal module.

Actually this is not going to be portable.
A better way would be to learn how to query information_schema that
*should* be portable.

information_schema should be in the sql-92 standard.

http://dev.mysql.com/doc/refman/5.0/en/information-schema.html
http://www.postgresql.org/docs/8.1/interactive/information-schema.html
http://www.ocelot.ca/is.htm

I think that in postgresql information_schema is just a view on the
internal format that should reside in pg_catalog. schema.

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 09/04/09
05:51:00



More information about the development mailing list