pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: thomas.silvi <thomas.silvi@laposte.net>
To: Roger Tannous <roger77_lb@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: column names, types, properties for a table
Date: Thu, 08 Sep 2005 22:37:50 +0200
Message-ID: <4320A11E.30502@laposte.net> (raw)
In-Reply-To: <20050907212543.88525.qmail@web51901.mail.yahoo.com>
References: <20050907212543.88525.qmail@web51901.mail.yahoo.com>


           Hello,
    there is the view "columns" in the schema "information_schema" that 
can give you most of the informations you need
    ( for PosgreSQL version >= 7.4.8 if I'm right).

    SELECT   *
    FROM     information_schema.columns
    WHERE    table_name = 'mytable';

    See 
http://www.postgresql.org/docs/8.0/interactive/infoschema-columns.html#AEN26185
      or  
http://www.postgresql.org/docs/8.0/static/infoschema-columns.html#AEN26185

       Regards,
             Thomas

Roger Tannous a écrit :

>Hi, 
>
>Is it possible to issue an SQL query that lists column names, types (int,
>varchar, boolean, etc.), properties (like NOT NULL or UNIQUE) 
>for a given table name ?
>
>
>Regards,
>Roger Tannous.
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: Don't 'kill -9' the postmaster
>
>  
>




view thread (4+ messages)

Message-ID: <4320A11E.30502@laposte.net>
Permalink:  ../4320A11E.30502@laposte.net/
Also on:    postgresql.org/message-id/4320A11E.30502@laposte.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: thomas.silvi@laposte.net, roger77_lb@yahoo.com
  Subject: Re: column names, types, properties for a table
  In-Reply-To: <4320A11E.30502@laposte.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox