X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 25E8DD8A60 for ; Thu, 8 Sep 2005 17:38:04 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20812-03 for ; Thu, 8 Sep 2005 20:37:54 +0000 (GMT) Received: from mx.laposte.net (mx.laposte.net [80.245.62.11]) by svr1.postgresql.org (Postfix) with ESMTP id 840C3D8AC2 for ; Thu, 8 Sep 2005 17:37:54 -0300 (ADT) Received: from [83.202.79.248] (83.202.79.248) by mx.laposte.net (7.2.060.1) (authenticated as thomas.silvi@laposte.net) id 431C605C0032F36D; Thu, 8 Sep 2005 22:37:53 +0200 Message-ID: <4320A11E.30502@laposte.net> Date: Thu, 08 Sep 2005 22:37:50 +0200 From: "thomas.silvi" Reply-To: thomas.silvi@laposte.net User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050322) X-Accept-Language: fr, en MIME-Version: 1.0 To: Roger Tannous Cc: pgsql-sql@postgresql.org Subject: Re: column names, types, properties for a table References: <20050907212543.88525.qmail@web51901.mail.yahoo.com> In-Reply-To: <20050907212543.88525.qmail@web51901.mail.yahoo.com> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/88 X-Sequence-Number: 22635 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 > > >