Re: Is a SERIAL column a "black box", or not?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Is a SERIAL column a "black box", or not?
Дата
Msg-id 21011.1146527226@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Is a SERIAL column a "black box", or not?  ("Jim C. Nasby" <jnasby@pervasive.com>)
Ответы Re: Is a SERIAL column a "black box", or not?  (elein <elein@varlena.com>)
Список pgsql-hackers
"Jim C. Nasby" <jnasby@pervasive.com> writes:
> I think a big point that's being missed here is that SERIAL *is* trying
> to be simple. If you need something more sophisticated or complex you
> shouldn't be using SERIAL at all, you should be doing the stuff
> yourself, by hand.

I agree with this point in the abstract, but one important proviso is
that it has to be *possible* to do it by hand.  One good thing about
the "SERIAL is just a macro" approach is that it keeps us honest about
making sure that SERIAL isn't exploiting any weird internal behaviors
that are hard to duplicate for handmade sequence defaults.  We've
already broken that to some extent by having the hidden dependency,
and that in turn means that fairly-reasonable expectations like
"pg_get_serial_sequence should find the column's associated sequence"
don't work on handmade sequences.  I don't want to go much further in
that direction.  If there's a usability problem we're trying to solve
for SERIALs, we should make sure the problem gets solved for handmade
sequences too.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Lukas Smith
Дата:
Сообщение: Re: Is a SERIAL column a "black box", or not?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Is a SERIAL column a "black box", or not?