Search Postgresql Archives

Re: Streaming replication: sequences on slave seemingly ahead of sequences on master

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Mon, May 7, 2012 at 4:01 AM, Vincent de Phily <vincent.dephily@xxxxxxxxxxxxxxxxx> wrote:
On Sunday 06 May 2012 10:29:17 Simon Riggs wrote:
> On 4 May 2012 14:55, Vincent de Phily <vincent.dephily@xxxxxxxxxxxxxxxxx>
wrote:


Would be nice to see it added to the documentation (unless I just didn't find
it ?), as it is quite surprising, and might lead to problems if people expect
to be able to read sequence values from the slave.

What people need to understand is that there is no way to 'read' a sequence value from a slave.  'SELECT * from sequence_name' will not reliably give you either the most recently assigned or the next sequence value.  This is currently covered in the documentation for sequences, but could probably be improved upon and mentioned somewhere in the documentation on setting up slave servers.  (I will look at adding it to the binary replication tutorial wiki page.)

Since 'nextval' cannot be called on a sequence on a slave (because a slave can only support read-only transactions), 'currval' will by definition return an error.

To cross-pollinate with another thread, if temporary tables (and insert/delete/update transactions to them) are to be supported on a slave, will the applications using those temporary tables expect to be able to use 'nextval' on inserts to temporary tables as well?
 
As a bonus question, I guess it would be the same if using synchroneous
replication ?

Yes.
--
Mike Nolan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux