Re: Retrieve columntypes and checks?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Jesper Krogh <jesper(at)krogh(dot)cc>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Retrieve columntypes and checks?
Date: 2004-10-28 17:33:20
Message-ID: 20041028173320.GA75259@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, Oct 28, 2004 at 10:27:30AM +0000, Jesper Krogh wrote:
>
> In PostgreSQL the enum's are converted to varchar with checks, so I need
> to get a hold on the column-type and if it's a varchar parse the check
> string for values..

Others have suggested that you let the database do the checking for
you. But if you want to see what the column types and constraints
are, you could query the system catalogs:

http://www.postgresql.org/docs/7.4/static/catalogs.html
http://www.postgresql.org/docs/7.4/static/information-schema.html

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2004-10-28 17:37:00 Re: Retrieve columntypes and checks?
Previous Message Tom Lane 2004-10-28 17:07:21 Re: Question Regarding Locks