pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Matt <matthew.berardi@weilpublishing.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: check
Date: Mon, 17 Jun 2002 07:55:23 -0700 (PDT)
Message-ID: <20020617075412.A49868-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <3D0A3A44.2090401@weilpublishing.com>

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).





view thread (4+ messages)  latest in thread

Message-ID: <20020617075412.A49868-100000@megazone23.bigpanda.com>
Permalink:  ../20020617075412.A49868-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020617075412.A49868-100000@megazone23.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, matthew.berardi@weilpublishing.com
  Subject: Re: check
  In-Reply-To: <20020617075412.A49868-100000@megazone23.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox