pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Bertheau <twanger@bluetwanger.de>
To: Michael A Nachbaur <mike@nachbaur.com>
Cc: PGSQL-SQL <pgsql-sql@postgresql.org>
Subject: Re: multi-table unique index
Date: 23 Jun 2003 21:08:37 +0200
Message-ID: <1056395317.2537.3.camel@saphir> (raw)
In-Reply-To: <200306231134.11430.mike@nachbaur.com>
References: <1056376700.2037.2.camel@fluor>
	<200306231032.56257.mike@nachbaur.com>
	<1056392214.3405.0.camel@saphir>
	<200306231134.11430.mike@nachbaur.com>

В Пнд, 23.06.2003, в 20:34, Michael A Nachbaur пишет:
> On Monday 23 June 2003 11:16 am, Markus Bertheau wrote:
> > В Пнд, 23.06.2003, в 19:32, Michael A Nachbaur пишет:
> > > Instead of using the "serial" datatype, you can set it to "int4 PRIMARY
> > > KEY DEFAULT nextval(foo_type_id_seq)" and you can manually create the
> > > sequence "foo_type_id_seq".
> > >
> > > This way all the tables share the same sequence.
> >
> > Yeah, but I want to force this behaviour. so that it cannot happen by
> > accident when you insert records without relying on the sequence.

> If you want to ensure that a value is unique when a record is inserted, even 
> if the user explicitly specifies an ID values, you can create a unique 
> trigger on the tables, but this depends on what you want to do.

I believe what you described is what I want to do. What's a unique
trigger, though?

-- 
Markus Bertheau.
Berlin, Berlin.
Germany.



view thread (6+ messages)  latest in thread

Message-ID: <1056395317.2537.3.camel@saphir>
Permalink:  ../1056395317.2537.3.camel@saphir/
Also on:    postgresql.org/message-id/1056395317.2537.3.camel@saphir

 · 

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: twanger@bluetwanger.de, mike@nachbaur.com
  Subject: Re: multi-table unique index
  In-Reply-To: <1056395317.2537.3.camel@saphir>

* 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