By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,512 Members | 644 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,512 IT Pros & Developers. It's quick & easy.

list tables from PHP

P: n/a
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
Share this Question
Share on Google+
1 Reply

P: n/a
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.