Forum OpenACS Q&A: Sql "select * from tables" how in pg

There are 603 tables in OpenACS. I was trying the .adp example from
ADP: Example 3: Return information from the database {www.aolserver.com/doc/3.0/tcldev/tadp-c11.htm#16804}. This page gives one a browser interface to the tables and fields. In part:

...
set db [ns_db gethandle]
set sql "select * from tables"
set row [ns_db select $db $sql]
while {[ns_db getrow $db $row]} {
set table [ns_set get $row name]
ns_puts "
This command returns nothing! also tried with the odd " mark which does a funny thing... perhaps a command continuation??? I tried set sql "select * from tables"with and without the ". Neither work, but the " requires a second " to end the command. mydata-# changes to mydat"# until it gets the second one.

Sooo: There appears to be no tables command in pg nor is there a "Tables" table in acs.
*** Is there a sql pg command that will list all the tables like the d command in psql? TIA -Bob

Collapse
Posted by Don Baccus on
There's documentation on system tables in the PG release.  I forget the name of the pg_* table you want, so you'll have to take a look yourself, I'm afraid.

If you look at your log file, I'm certain you'll find an error message  due to "tables" not existing.  The blank page is resulting because you've not caught the error, and presumably have the Tcl stack trace turned off.