Re: repost of how to do select in a constraint

From: "Peter Gibbs" <peter(at)emkel(dot)co(dot)za>
To: <gearond(at)cvc(dot)net>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: repost of how to do select in a constraint
Date: 2003-01-22 06:11:41
Message-ID: 000f01c2c1dd$2362b5c0$0b01010a@emkel.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dennis Gearon wrote:

> Can I reference a function in a column check constraint, when the function
doesn't yet exist,
> i.e. a the time of table creation?
>
> Or is it better to make the table, create the function, then alter table
with a check
> constraint?

The function has to exist before the constraint is created. If the function
depends on the table that will have the constraint, you will need to add the
constraint afterwards; however, if the function only depends on other
tables, then you can create the function before creating the table.
--
Peter Gibbs
EmKel Systems

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Qiao Jian ( Net2Room) 2003-01-22 06:13:51 Re: FW: ERROR: Relation "pg_user" does not exist
Previous Message Antti Haapala 2003-01-22 06:00:36 Re: loading delimited files