Re: Problems with Binary Replication

From: Michael Nolan <htfoot(at)gmail(dot)com>
To: Andreas <maps(dot)on(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Problems with Binary Replication
Date: 2012-04-01 00:59:05
Message-ID: CAOzAquJAr-pzCkWpsYvjHPRJw0Zuz6c2j=g9v1ym68TQacB-sA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Mar 31, 2012 at 6:58 PM, Andreas <maps(dot)on(at)gmx(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albert 2012-04-01 05:50:49 Re: PostgreSQL Trigger and rows updated
Previous Message Jasen Betts 2012-04-01 00:04:22 Re: loading a function from a file