Re: Remove implicit unique index creation on SERIAL columns?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: Joe Conway <mail(at)joeconway(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Rod Taylor <rbt(at)zort(dot)ca>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Remove implicit unique index creation on SERIAL columns?
Date: 2002-08-20 03:17:55
Message-ID: 200208200317.g7K3Htp19255@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stephan Szabo wrote:
> > If don't understand. We already have a unique index on the SERIAL
> > column, so why bother rejecting an insert/update that supplies the
> > value? We need the column to be unique, and that is forced, but why
> > prevent _any_ unique value from being used.
>
> One reason is that the sequence won't respect those inserted values and
> you'll get uniqueness errors on statements that don't give a value for the
> column where you'd expect to be getting a working autogenerated value.

Oh, it causes problems later on. Interesting. However, preventing
INSERT/UPDATE seems quite extreme.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-08-20 03:24:43 Re: @(#) Mordred Labs advisory 0x0001: Buffer overflow in
Previous Message Justin Clift 2002-08-20 03:17:44 Re: @(#) Mordred Labs advisory 0x0001: Buffer overflow in