Re: sequences and "addval('myseq', value)"

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: sequences and "addval('myseq', value)"
Дата
Msg-id 659.1086701713@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: sequences and "addval('myseq', value)"  (pgsql@mohawksoft.com)
Ответы Re: sequences and "addval('myseq', value)"  (pgsql@mohawksoft.com)
Список pgsql-hackers
pgsql@mohawksoft.com writes:
> The question is, what do you think of an "addval" function for sequences.

It would have to be defined as "do the same thing as N successive
nextval calls would do", which would not be especially useful in the
presence of caching.

> The problem I, and I know many other people are having, is that large sums
> can not be obtained without a table scan. A summary table can be created,
> but if you have any sort of volume, you have to vacuum the summary table
> constantly.
> Using the sequence construct as sort of an accumulator just might fit the
> bill for this sort of thing.

How would it work at all?  Suppose your transaction rolls back after
doing the insert or update.  The table won't have changed ... but the
sequence change doesn't roll back.  You can't make such an easy end run
around the fundamental MVCC/locking problem.
        regards, tom lane


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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: [GENERAL] The pgreplication project
Следующее
От: Fabien COELHO
Дата:
Сообщение: cvs head : broken regression tests ?