[development] Postgres equivalent to SHOW TABLES

Ivan Sergio Borgonovo mail at webthatworks.it
Fri Sep 4 20:41:53 UTC 2009


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



More information about the development mailing list