Re: ?How create a one serial decimal(500,0) column or simulate itwith bigint multicolumns serial?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: ?How create a one serial decimal(500,0) column or simulate itwith bigint multicolumns serial?
Дата
Msg-id CAKFQuwaNZS5ODiZgR=Lps2ELXFdq5Jf5Dq8NFCbkadAmJwAgDA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ?How create a one serial decimal(500,0) column or simulate itwith bigint multicolumns serial?  (Dani <danielcheagle@gmail.com>)
Список pgsql-novice
On Sunday, January 7, 2018, Dani <danielcheagle@gmail.com> wrote:
Hi!
  Thanks for the quotes!

  My need is one column per table (primary id and auto_increment) and bigger max value than bigint :-). for now the max value for a sequence
in Postgresql is bigint.


Create two bigint sequences.  Call nextval on the first one. If the value given is somewhere near the max call nextval on the other and reset the first one,  otherwise use currentval on the other sequence.

That should get you started: the docs should be able to fill in the blanks.

Frankly, I'd wait to add that second bigint until you are nearing exhaustion of the first bigint sequence.  Given you expected volume how long until the first sequence is exhausted?

David J.

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

Предыдущее
От: Dani
Дата:
Сообщение: Re: ?How create a one serial decimal(500,0) column or simulate itwith bigint multicolumns serial?
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: ?How create a one serial decimal(500,0) column or simulate itwith bigint multicolumns serial?