470,614 Members | 1,396 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,614 developers. It's quick & easy.

list tables from PHP

Hello, i can't find any matching answer for this question.

How to construct SQL query to list all tables in current database? Let's say
i use the default view. Or maybe there is better way in PHP to do it?

PostgreSQL version 7.3.

TIA

--
Mariusz Kaczmarczyk 'koshmar' | mailto:koshmar/DELETE/@poczta.fm
jabber: koshmar/DELETE/@amessage.info | GG: 1797253
http://www.ck-la.tk/ | http://www.mieszkanie-prawem.w.pl/
Jul 19 '05 #1
1 5652
Mariusz Kaczmarczyk wrote:
How to construct SQL query to list all tables in current database? Let's
say i use the default view. Or maybe there is better way in PHP to do it?


I have already found it, 15 minutes after posting (and after 1 day of
looking for it previously).

Use
SELECT relname FROM pg_stat_user_tables ORDER BY relname

--
Mariusz Kaczmarczyk 'koshmar' | mailto:koshmar/DELETE/@poczta.fm
jabber: koshmar/DELETE/@amessage.info | GG: 1797253
http://www.ck-la.tk/ | http://www.mieszkanie-prawem.w.pl/
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by picander77 | last post: by
2 posts views Thread by Brian Henry | last post: by
5 posts views Thread by Javed | last post: by
5 posts views Thread by Lee Brotzman | last post: by
7 posts views Thread by =?Utf-8?B?UmVraGE=?= | last post: by
1 post views Thread by raam | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.