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

Поиск
Список
Период
Сортировка
От Michael Nolan
Тема Re: Streaming replication: sequences on slave seemingly ahead of sequences on master
Дата
Msg-id CAOzAqu+yuSTFgp41PQ4KSrP5x+CO+y+m7d7dh5Qa-bPEp8ybbQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Streaming replication: sequences on slave seemingly ahead of sequences on master  (Vincent de Phily <vincent.dephily@mobile-devices.fr>)
Ответы Re: Streaming replication: sequences on slave seemingly ahead of sequences on master  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general


On Mon, May 7, 2012 at 4:01 AM, Vincent de Phily <vincent.dephily@mobile-devices.fr> wrote:
On Sunday 06 May 2012 10:29:17 Simon Riggs wrote:
> On 4 May 2012 14:55, Vincent de Phily <vincent.dephily@mobile-devices.fr>
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

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Streaming replication: sequences on slave seemingly ahead of sequences on master
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: Streaming replication: sequences on slave seemingly ahead of sequences on master