Re: Remove implicit unique index creation on SERIAL columns?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Remove implicit unique index creation on SERIAL columns?
Дата
Msg-id 24150.1029689207@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Remove implicit unique index creation on SERIAL columns?  (Joe Conway <mail@joeconway.com>)
Ответы Re: Remove implicit unique index creation on SERIAL
Список 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 по дате отправления:

Предыдущее
От: "Nigel J. Andrews"
Дата:
Сообщение: Re: Open 7.3 issues
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCHES] Better handling of parse errors