Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id DDCC12E33B7 for ; Mon, 17 Dec 2007 14:03:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 20083-07 for ; Mon, 17 Dec 2007 14:03:17 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B09352E32BD for ; Mon, 17 Dec 2007 14:03:27 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id lBHI3KYR022678; Mon, 17 Dec 2007 13:03:20 -0500 (EST) To: Erik Jones cc: danap@dandymadeproductions.com, pgsql-sql@postgresql.org Subject: Re: Describe Table In-reply-to: References: <20071217165211.E18222E3202@postgresql.org> Comments: In-reply-to Erik Jones message dated "Mon, 17 Dec 2007 11:33:38 -0600" Date: Mon, 17 Dec 2007 13:03:20 -0500 Message-ID: <22677.1197914600@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/95 X-Sequence-Number: 29787 Erik Jones writes: > wrote: >> I've reviewed much of the documentation and the forums, >> but unable to seem to find a easy way to obtain the same >> thing as the 'psql \d table' through sql. > If you start psql with the -E flag, it will display all sql generated > by internal commands such as those generated by \d commands. Another alternative is to run "pg_dump -s -t "; that will get you a lot closer to SQL-ready output, and you won't need to worry as much about updating your code for future system catalog changes. regards, tom lane