Re: Notes about int8 sequences

Поиск
Список
Период
Сортировка
От Allan Engelhardt
Тема Re: Notes about int8 sequences
Дата
Msg-id 3B6F0AF2.7EBB0E36@cybaea.com
обсуждение исходный текст
Ответ на Notes about int8 sequences  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:

> * How should one invoke nextval() and friends on such a sequence?
> Directly applying the existing convention, eg, nextval('sequencename'),
> won't work because those functions are declared to return int4.  One

I'm not really a hacker, but why couldn't you simply change nextval to return int8 in all cases?  Presumably there is
anautomatic (and silent) conversion from int8 to int4 where the range fits?  The overhead of creating an int8 return
valuefor an old-style int4 sequence (and converting it back to int4 for the INSERT/UPDATE) seems very small.
 

I'm missing something obvious again?


Allan.



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Notes about int8 sequences
Следующее
От: Giles Lean
Дата:
Сообщение: Re: Possible solution for LIKE optimization