<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Display or show tables in a PostgreSQL/PgSQL database</title>
	<atom:link href="http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/</link>
	<description>Computer and technology tutorials and guides</description>
	<lastBuildDate>Sun, 22 Nov 2009 00:56:44 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: </title>
		<link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/comment-page-1/#comment-2231</link>
		<dc:creator></dc:creator>
		<pubDate>Mon, 17 Oct 2005 15:30:30 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-2231</guid>
		<description>For those coming from MySQL:
SHOW TABLES = d
SHOW DATABASES = l
SHOW COLUMNS = d table

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:

So in the psql console type 
l to see the databases, 
d ....


SHOW TABLES (d) = SELECT table_name FROM information_schema.tables WHERE table_schema = &#039;public&#039;

SHOW DATABASES (l) = SELECT datname FROM pg_database;

SHOW COLUMNS FROM table (d table) = SELECT column_name FROM information_schema.columns WHERE table_name =&#039;table&#039;;


Check the user comment on this postgre doc. page
http://www.postgresql.org/docs/8.0/interactive/tutorial-accessdb.html

&lt;ul id=&quot;quote&quot;&gt;&lt;h6&gt;none wrote:&lt;/h6&gt;Is there any equivalent form for this in SQL?&lt;/ul&gt;</description>
		<content:encoded><![CDATA[<p>For those coming from MySQL:<br />
SHOW TABLES = d<br />
SHOW DATABASES = l<br />
SHOW COLUMNS = d table</p>
<p>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:</p>
<p>So in the psql console type<br />
l to see the databases,<br />
d &#8230;.</p>
<p>SHOW TABLES (d) = SELECT table_name FROM information_schema.tables WHERE table_schema = &#8216;public&#8217;</p>
<p>SHOW DATABASES (l) = SELECT datname FROM pg_database;</p>
<p>SHOW COLUMNS FROM table (d table) = SELECT column_name FROM information_schema.columns WHERE table_name =&#8217;table&#8217;;</p>
<p>Check the user comment on this postgre doc. page<br />
<a href="http://www.postgresql.org/docs/8.0/interactive/tutorial-accessdb.html" rel="nofollow">http://www.postgresql.org/docs/8.0/interactive/tutorial-accessdb.html</a></p>
<ul id="quote">
<h6>none wrote:</h6>
<p>Is there any equivalent form for this in SQL?</ul>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/comment-page-1/#comment-1969</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 14 Jun 2005 04:57:27 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-1969</guid>
		<description>This works for me:

select pg_class.relname, pg_attribute.attname, pg_type.typname from pg_class, pg_attribute, pg_type  where pg_class.relname = &#039;YOURTABLENAME&#039; and pg_class.oid = pg_attribute.attrelid and pg_type.oid = pg_attribute.atttypid having attnum &gt; 0

Ivan</description>
		<content:encoded><![CDATA[<p>This works for me:</p>
<p>select pg_class.relname, pg_attribute.attname, pg_type.typname from pg_class, pg_attribute, pg_type  where pg_class.relname = &#8216;YOURTABLENAME&#8217; and pg_class.oid = pg_attribute.attrelid and pg_type.oid = pg_attribute.atttypid having attnum &gt; 0</p>
<p>Ivan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: none</title>
		<link>http://www.tech-recipes.com/rx/279/display-or-show-tables-in-a-postgresqlpgsql-database/comment-page-1/#comment-1912</link>
		<dc:creator>none</dc:creator>
		<pubDate>Thu, 26 May 2005 03:55:23 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-1912</guid>
		<description>Is there any equivalent form for this in SQL?</description>
		<content:encoded><![CDATA[<p>Is there any equivalent form for this in SQL?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
