Re: Remove implicit unique index creation on SERIAL columns? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Remove implicit unique index creation on SERIAL columns?
Date
Msg-id 24150.1029689207@sss.pgh.pa.us
Whole thread Raw
In response to Re: Remove implicit unique index creation on SERIAL columns?  (Joe Conway <mail@joeconway.com>)
Responses Re: Remove implicit unique index creation on SERIAL  (Rod Taylor <rbt@zort.ca>)
List pgsql-hackers
Joe Conway <mail@joeconway.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


pgsql-hackers by date:

Previous
From: "Nigel J. Andrews"
Date:
Subject: Re: Open 7.3 issues
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] Better handling of parse errors