pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomasz Myrta <jasiek@klaster.net>
To: Agnieszka Rutkowska <agr225@cse.unsw.EDU.AU>
Cc: pgsql-sql@postgresql.org
Subject: Re: extracting constraints from schema
Date: Mon, 03 Feb 2003 00:51:29 +0100
Message-ID: <3E3DAF01.8030006@klaster.net> (raw)
References: <Pine.LNX.4.44.0301291520380.16179-100000@piano07.orchestra.cse.unsw.EDU.AU>

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




view thread (2+ messages)

Message-ID: <3E3DAF01.8030006@klaster.net>
Permalink:  ../3E3DAF01.8030006@klaster.net/
Also on:    postgresql.org/message-id/3E3DAF01.8030006@klaster.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: jasiek@klaster.net, agr225@cse.unsw.EDU.AU
  Subject: Re: extracting constraints from schema
  In-Reply-To: <3E3DAF01.8030006@klaster.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