From: | Wouter D'Haeseleer <wdh(at)vasco(dot)com> |
---|---|
To: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Hot-Standby and sequences |
Date: | 2011-02-02 11:03:52 |
Message-ID: | 1296644632.8673.30.camel@gibralter |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi All,
I have a question about sequences in combination with streaming
replication.
It seems something strange is happening with sequences which are
streamed to the slave.
When updating the sequence the last_value on the slave shifts with 32
and halts at this value until the master increased the value also with
32.
Is this normal behavior ?
Please see the example below:
Using Setval
----------------------
# psql -t -h master -c "select setval('foo', 10)"
10
# psql -t -h master -c "select last_value from foo"
10
# psql -t -h slave -c "select last_value from foo"
10
Using Nextval
----------------------
# psql -t -h master -c "select nextval('foo')"
11
# psql -t -h master -c "select last_value from foo"
11
# psql -t -h slave -c "select last_value from foo"
43
--
Wouter D'Haeseleer
Linux System Engineer
VASCO Data Security
Dellingstraat 28b
2800 Mechelen
Belgium
phone: +32 15 50 44 00
email: wdh(at)vasco(dot)com
web: www.vasco.com
From | Date | Subject | |
---|---|---|---|
Next Message | Sergey Zaharchenko | 2011-02-02 11:49:04 | Query plan optimization: sorting vs. partitioning |
Previous Message | Wouter D'Haeseleer | 2011-02-02 10:32:33 | Hot-Standby and sequences |