Re: check - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: check
Date
Msg-id 20020617075412.A49868-100000@megazone23.bigpanda.com
Whole thread Raw
In response to check  (Matt <matthew.berardi@weilpublishing.com>)
List pgsql-sql
On Fri, 14 Jun 2002, Matt wrote:

> how would you go about enforcing the default value:
>
> I have a nextval('seq') as my default and on an insert I don't want any
> other value to be allowed.

Don't do a default, do a before trigger that sets the value so that even
if a value is specified it uses the sequence anyway (or you could
potentially check that it's currently null and error I guess as well).




pgsql-sql by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: Re: check
Next
From: Manfred Koizar
Date:
Subject: Re: check