Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id D121B9FA5B5 for ; Tue, 31 Oct 2006 06:42:00 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 84435-03 for ; Tue, 31 Oct 2006 10:41:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web33311.mail.mud.yahoo.com (web33311.mail.mud.yahoo.com [68.142.206.126]) by postgresql.org (Postfix) with SMTP id 1B86E9FA12B for ; Tue, 31 Oct 2006 06:41:57 -0400 (AST) Received: (qmail 31881 invoked by uid 60001); 31 Oct 2006 10:41:56 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=VlgKztH+B4KYfqIa16qdw+fTQbvMKdiIs+r9Bomdn+2GhWxKSvoNTV/HMWRgN4ooYLG6Pn0f+Bs+Kd/LPqgDyLJjL1/kcoIzDT0eH7JXrj/lqzhsNTMzJXXCQ+oHSf3pdbTipaG6neflsV9Ke+nMUbedifzZ0M8CCpQuPNUn80c= ; Message-ID: <20061031104155.31879.qmail@web33311.mail.mud.yahoo.com> Received: from [220.225.70.2] by web33311.mail.mud.yahoo.com via HTTP; Tue, 31 Oct 2006 02:41:55 PST Date: Tue, 31 Oct 2006 02:41:55 -0800 (PST) From: Sandeep Khandelwal Subject: Re: How to get table definition of a PostgreSQL table To: sdavis2@mail.nih.gov, pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.536 tagged_above=0 required=5 tests=BAYES_05, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, FROM_HAS_ULINE_NUMS X-Spam-Level: ** X-Archive-Number: 200610/32 X-Sequence-Number: 6315 Thank you so much Sean.=0A =0ASandeep =0A=0A=0A----- Original Message ----= =0AFrom: Sean Davis =0ATo: pgsql-interfaces@postgresq= l.org=0ACc: Sandeep Khandelwal =0ASent: Fri= day, October 27, 2006 4:23:18 PM=0ASubject: Re: [INTERFACES] How to get tab= le definition of a PostgreSQL table=0A=0A=0AOn Friday 27 October 2006 02:25= , Sandeep Khandelwal wrote:=0A> Hi.=0A>=0A> I would like to get field's nam= e, datatype of each field, length of each=0A> field and precision of each f= ield of a PostgreSQL table. Please let me SQL=0A> query to get this informa= tion.=0A=0ASee these two chapters in the postgresql docs:=0A=0Ahttp://www.p= ostgresql.org/docs/8.1/interactive/catalogs.html=0Ahttp://www.postgresql.or= g/docs/8.1/interactive/information-schema.html=0A=0AEach has advantages ove= r the other.=0A=0AAlso, if you start psql with the flag --echo-hidden, when= you do commands like =0A\dt and \d+, psql will show you the sql it uses to= produce that output.=0A=0ASean=0A=0A