<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Tech-Recipes - Latest Comments in Display or show tables in a PostgreSQL/PgSQL database | PostgreSQL PgSQL | Tech-Recipes</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><language>en</language><lastBuildDate>Mon, 17 Oct 2005 11:30:30 -0000</lastBuildDate><item><title>Re: Display or show tables in a PostgreSQL/PgSQL database | PostgreSQL PgSQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/#comment-2767258</link><description>For those coming from MySQL:&lt;br&gt;SHOW TABLES = d&lt;br&gt;SHOW DATABASES = l&lt;br&gt;SHOW COLUMNS = d table&lt;br&gt;&lt;br&gt;However the * commands only work in psql and not via other interfaces, such as queries via PHP. Similar data can be retrieved with the following SQL commands:&lt;br&gt;&lt;br&gt;So in the psql console type &lt;br&gt;l to see the databases, &lt;br&gt;d ....&lt;br&gt;&lt;br&gt;&lt;br&gt;SHOW TABLES (d) = SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'&lt;br&gt;&lt;br&gt;SHOW DATABASES (l) = SELECT datname FROM pg_database;&lt;br&gt;&lt;br&gt;SHOW COLUMNS FROM table (d table) = SELECT column_name FROM information_schema.columns WHERE table_name ='table';&lt;br&gt;&lt;br&gt;&lt;br&gt;Check the user comment on this postgre doc. page&lt;br&gt;&lt;a href="http://www.postgresql.org/docs/8.0/interactive/tutorial-accessdb.html" rel="nofollow"&gt;http://www.postgresql.org/docs/8.0/interactive/...&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;lt;ul id="quote"&amp;gt;&amp;lt;h6&amp;gt;none wrote:&amp;lt;/h6&amp;gt;Is there any equivalent form for this in SQL?&amp;lt;/ul&amp;gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Mon, 17 Oct 2005 11:30:30 -0000</pubDate></item><item><title>Re: Display or show tables in a PostgreSQL/PgSQL database | PostgreSQL PgSQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/#comment-2767257</link><description>This works for me:&lt;br&gt;&lt;br&gt;select pg_class.relname, pg_attribute.attname, pg_type.typname from pg_class, pg_attribute, pg_type  where pg_class.relname = 'YOURTABLENAME' and pg_class.oid = pg_attribute.attrelid and pg_type.oid = pg_attribute.atttypid having attnum &amp;gt; 0&lt;br&gt;&lt;br&gt;Ivan</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Tue, 14 Jun 2005 00:57:27 -0000</pubDate></item><item><title>Re: Display or show tables in a PostgreSQL/PgSQL database | PostgreSQL PgSQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/#comment-2767256</link><description>Is there any equivalent form for this in SQL?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">none</dc:creator><pubDate>Wed, 25 May 2005 23:55:23 -0000</pubDate></item></channel></rss>