Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 4ECE44765B9 for ; Mon, 17 Jun 2002 11:57:01 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id F365D476274 for ; Mon, 17 Jun 2002 10:55:18 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 650CBD608; Mon, 17 Jun 2002 07:55:23 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 5ABA65C02; Mon, 17 Jun 2002 07:55:23 -0700 (PDT) Date: Mon, 17 Jun 2002 07:55:23 -0700 (PDT) From: Stephan Szabo To: Matt Cc: Subject: Re: check In-Reply-To: <3D0A3A44.2090401@weilpublishing.com> Message-ID: <20020617075412.A49868-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200206/218 X-Sequence-Number: 8183 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).