Page 1 of 1

PostgreSQL support with PHP needed

Posted: Sat Sep 13, 2008 2:47 am
by belliash
Hi,

I would like to rewrite some function i have already written that it may work with PgSQL, but i have no idea how to obtain tables list like i have it done for MySQL. The code i have actually written (for MySQL) is available here http://paste.epheket.ath.cx/ae58cd732a.html and i would be really thankful if you could help me with making it working for PgSQL.


Thanks!

Re: PostgreSQL support with PHP needed

Posted: Sat Sep 13, 2008 6:36 am
by VladSun
From http://www.tech-recipes.com/modules.php ... pic&t=1052

[sql]SHOW TABLES (d) = SELECT table_name FROM information_schema.TABLES WHERE table_schema = 'public'  SHOW DATABASES (l) = SELECT datname FROM pg_database;  SHOW COLUMNS FROM TABLE (d TABLE) = SELECT column_name FROM information_schema.COLUMNS WHERE table_name ='table';[/sql]