Re: extracting constraints from schema

From: Tomasz Myrta <jasiek(at)klaster(dot)net>
To: Agnieszka Rutkowska <agr225(at)cse(dot)unsw(dot)EDU(dot)AU>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: extracting constraints from schema
Date: 2003-02-02 23:51:29
Message-ID: 3E3DAF01.8030006@klaster.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message jack 2003-02-03 00:54:35 window version of psql of postgreSQL v7.3.1
Previous Message Oliver Elphick 2003-02-02 22:12:01 Re: