Re: Problems with Binary Replication

Поиск
Список
Период
Сортировка
От Michael Nolan
Тема Re: Problems with Binary Replication
Дата
Msg-id CAOzAquJAr-pzCkWpsYvjHPRJw0Zuz6c2j=g9v1ym68TQacB-sA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Problems with Binary Replication  (Andreas <maps.on@gmx.net>)
Список pgsql-general


On Sat, Mar 31, 2012 at 6:58 PM, Andreas <maps.on@gmx.net> wrote:


Now what could one do to prevent those sequence gaps?
There might be scenarios where it's important not to have gaps in the numbering even when one has to switch to the standby if there is a failiour on the master.
E.g. numbers of invoices need to be gapless.


Then you may need to find some other way within your application to assign invoice numbers, because sequences aren't GUARANTEED not to have gaps, especially if there is a failure of the primary server that results in a switch over to the standby server.

A transaction that is rolled back (such as due to an error) after the nextval() function has been called will not roll back the sequence value, for example.

You cannot issue a nextval() call on a standby server, because it is in read-only mode.
--
MIke Nolan

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

Предыдущее
От: Jasen Betts
Дата:
Сообщение: Re: loading a function from a file
Следующее
От: Albert
Дата:
Сообщение: Re: PostgreSQL Trigger and rows updated