X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 5464E475E77 for ; Sun, 2 Feb 2003 18:46:51 -0500 (EST) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id 2B9FF475CB4 for ; Sun, 2 Feb 2003 18:46:47 -0500 (EST) Received: from klaster.net (pe66.krakow.cvx.ppp.tpnet.pl [213.76.40.66]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 7CBA02B6F7; Mon, 3 Feb 2003 00:40:07 +0100 (CET) Message-ID: <3E3DAF01.8030006@klaster.net> Date: Mon, 03 Feb 2003 00:51:29 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; PL; rv:1.1) Gecko/20020826 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Agnieszka Rutkowska Cc: pgsql-sql@postgresql.org Subject: Re: extracting constraints from schema References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/42 X-Sequence-Number: 11440 Agnieszka Rutkowska wrote: > Hi, > > I was just wondering whether you happen to know how to extract what the > table and column constraints are using jdbc? > The API provides methods for extracting meta data on the table names, > column names, primary and foreigh keys as well as column types and sizes. > What about extracting constraints such as > > salary real CHECK (salary >= 10000) > > ? > It is possible to obtain the column name 'salary' as well as its types as > being 'real' but how about the CHECK condition?? Can it be done using > jdbc? > > Thanks for your time and help > Agnes Did you try to extract any information from system table pg_constraint? contype='C' is a CHECK condition. I think you can parse some additional information from column consrc. Description of all columns in this table is in "Chapter 3. System Catalogs 10. pg_constraint" at Postgresql documentation. Regards, Tomasz Myrta