Re: Remove implicit unique index creation on SERIAL columns?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: 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-18 16:46:47
Message-ID: 24150.1029689207@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joe Conway <mail(at)joeconway(dot)com> writes:
> I know this causes problems for dumped and reloaded data.

Yup.

> In MSSQL this
> is gotten around by allowing the properties of the data type to be
> altered, e.g. in MSSQL you can turn the IDENTITY property on or off

Rather pointless if it can be turned off, wouldn't you say?

What I would do if I wanted such a guarantee is to make insertions
go through a view rule that prevents the serial column from being
supplied directly. That's a general technique that applies to more than
just serial columns, and it is also easy to control who has privileges
to bypass the view. AFAICT this "IDENTITY" thingie is an extremely
limited kluge.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-08-18 16:53:07 Re: [PATCHES] Better handling of parse errors
Previous Message Nigel J. Andrews 2002-08-18 16:26:04 Re: Open 7.3 issues