Re: newbie question... how do I get table structure?

From: "Henrik Steffen" <steffen(at)city-map(dot)de>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: newbie question... how do I get table structure?
Date: 2004-02-06 15:01:06
Message-ID: 028f01c3ecc2$0beedd40$9800a8c0@henrik
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


try something like this:

select attname from pg_class, pg_attribute where
relname='your_tablename' and attrelid=relfilenode;

--

Mit freundlichem Gruß

Henrik Steffen
Geschäftsführer

top concepts Internetmarketing GmbH
Am Steinkamp 7 - D-21684 Stade - Germany
--------------------------------------------------------
http://www.topconcepts.com Tel. +49 4141 991230
mail: steffen(at)topconcepts(dot)com Fax. +49 4141 991233
--------------------------------------------------------
Ihr SMS-Gateway: JETZT NEU unter: http://sms.city-map.de
System-Partner gesucht: http://www.franchise.city-map.de
--------------------------------------------------------
Handelsregister: AG Stade HRB 5811 - UstId: DE 213645563
--------------------------------------------------------

> -----Ursprüngliche Nachricht-----
> Von: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org] Im Auftrag von
> Aaron Bratcher
> Gesendet: Freitag, 6. Februar 2004 15:10
> An: pgsql-general(at)postgresql(dot)org
> Betreff: Re: [GENERAL] newbie question... how do I get table
> structure?
>
>
> Is there no way I can do it with a standard select command in a
> different client? I don't need the indexes, just the column
> names/types.
> --
> Aaron Bratcher
> ab DataTools
> http://www.abDataTools.com
>
>
> On Feb 6, 2004, at 8:12 AM, Harald Fuchs wrote:
>
> > In article <4022FB80(dot)6090205(at)commandprompt(dot)com>,
> > "Joshua D. Drake" <jd(at)commandprompt(dot)com> writes:
> >
> >> Aaron Bratcher wrote:
> >>> What command can I use to get the structure of a given table?
> >>>
> >
> >
> >> If psql is client
> >
> >> \d tablename
> >
> > Without psql you can use
> >
> > pg_dump -s DBNAME -t TBLNAME
> >
> > from your shell prompt.
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Wei Wang 2004-02-06 15:01:35 Run 2 versions of Postgresql on one machine?
Previous Message Franco Bruno Borghesi 2004-02-06 15:00:46 Re: newbie question... how do I get table structure?