<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Tech-Recipes - Latest Comments in Display or show tables in a PostgreSQL/PgSQL database</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><atom:link href="https://tech-recipes.disqus.com/display_or_show_tables_in_a_postgresqlpgsql_database_postgresql_pgsql_tech_recipes/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 13 Jul 2011 14:46:19 -0000</lastBuildDate><item><title>Re: Display or show tables in a PostgreSQL/PgSQL database</title><link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/#comment-250987115</link><description>&lt;p&gt;Thanks :) It worked &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">runa</dc:creator><pubDate>Wed, 13 Jul 2011 14:46:19 -0000</pubDate></item><item><title>Re: Display or show tables in a PostgreSQL/PgSQL database</title><link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/#comment-108757731</link><description>&lt;p&gt;    select &lt;br&gt;      ordinal_position, &lt;br&gt;      column_name, &lt;br&gt;      data_type, &lt;br&gt;      is_nullable,&lt;br&gt;      description.description as comment&lt;br&gt;  from &lt;br&gt;      information_schema.columns columns&lt;br&gt;      left join pg_class class on (columns.table_name = class.relname)&lt;br&gt;      left join pg_description description on (class.oid = description.objoid)&lt;br&gt;      left join pg_attribute attrib on  (class.oid = attrib.attrelid and columns.column_name = attrib.attname and attrib.attnum = description.objsubid)&lt;br&gt;  where &lt;br&gt;    table_name='{$tableName}' &lt;br&gt;  group by&lt;br&gt;    ordinal_position, column_name, data_type, is_nullable, description.description&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Guest</dc:creator><pubDate>Wed, 08 Dec 2010 14:07:11 -0000</pubDate></item><item><title>Re: Display or show tables in a PostgreSQL/PgSQL database</title><link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/#comment-76443846</link><description>&lt;p&gt;So what? Still worked for me...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Joe</dc:creator><pubDate>Thu, 09 Sep 2010 17:03:20 -0000</pubDate></item><item><title>Re: Display or show tables in a PostgreSQL/PgSQL database</title><link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/#comment-68441208</link><description>&lt;p&gt;You can receive column comments in SQL:&lt;/p&gt;&lt;p&gt;SELECT a.attname AS column, d.description AS COMMENT&lt;br&gt;FROM pg_class c &lt;br&gt;JOIN pg_description d ON c.oid=d.objoid&lt;br&gt;JOIN pg_attribute a ON c.oid = a.attrelid&lt;br&gt;WHERE c.relname='monitors'&lt;br&gt;AND a.attnum = d.objsubid&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Marek Pe</dc:creator><pubDate>Fri, 13 Aug 2010 03:17:35 -0000</pubDate></item><item><title>Re: Display or show tables in a PostgreSQL/PgSQL database</title><link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/#comment-51680838</link><description>&lt;p&gt;very old post :(&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noMan</dc:creator><pubDate>Mon, 24 May 2010 06:45:09 -0000</pubDate></item><item><title>Re: Display or show tables in a PostgreSQL/PgSQL database</title><link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/#comment-2767258</link><description>&lt;p&gt;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;/p&gt;&lt;p&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;/p&gt;&lt;p&gt;So in the psql console type &lt;br&gt;l to see the databases, &lt;br&gt;d ....&lt;/p&gt;&lt;p&gt;SHOW TABLES (d) = SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'&lt;/p&gt;&lt;p&gt;SHOW DATABASES (l) = SELECT datname FROM pg_database;&lt;/p&gt;&lt;p&gt;SHOW COLUMNS FROM table (d table) = SELECT column_name FROM information_schema.columns WHERE table_name ='table';&lt;/p&gt;&lt;p&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 noopener" target="_blank" title="http://www.postgresql.org/docs/8.0/interactive/tutorial-accessdb.html"&gt;http://www.postgresql.org/d...&lt;/a&gt;&lt;/p&gt;&lt;p&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;&lt;/p&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</title><link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/#comment-2767257</link><description>&lt;p&gt;This works for me:&lt;/p&gt;&lt;p&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;/p&gt;&lt;p&gt;Ivan&lt;/p&gt;</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</title><link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/#comment-2767256</link><description>&lt;p&gt;Is there any equivalent form for this in SQL?&lt;/p&gt;</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>