Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group