<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 13-08-21 08:23 PM, Tatsuo Ishii
wrote:<br>
</div>
<blockquote
cite="mid:20130822.075341.2182430226914513670.t-ishii@sraoss.co.jp"
type="cite">
<blockquote type="cite">
Ah, I believe I understand the problem now: the sequence values
are
different (off by one) between the original and recovered
databases.
The sample pgpool_sample_pitr script has: SELECT setval(oid,
nextval(oid)) FROM pg_class WHERE relkind = 'S'
When I change that to SELECT setval(oid, 1*currval(oid)) FROM
pg_class WHERE relkind = 'S'
I get identical databases and the problem has not reoccurred!
(The
"1*" is to defeat optimization; not sure if it is needed.)
Thanks for your excellent advice.
</blockquote>
<pre wrap="">
Thanks for the report but your changes seems a little bit strange to
me. According to the PostgreSQL manual, calling currval() without
prior calling nextval() will raise an error. Don't you get any error?
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: <a class="moz-txt-link-freetext" href="http://www.sraoss.co.jp/index_en.php">http://www.sraoss.co.jp/index_en.php</a>
Japanese: <a class="moz-txt-link-freetext" href="http://www.sraoss.co.jp">http://www.sraoss.co.jp</a>
</pre>
</blockquote>
<br>
That's interesting, I was unaware of that restriction on currval.
Indeed if I run the script manually I do get an error. Now I'm
quite confused, because the overall effect is what I need. Based on
the manual page at
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="http://www.postgresql.org/docs/9.2/static/functions-sequence.html">http://www.postgresql.org/docs/9.2/static/functions-sequence.html</a>
if appears the following will work:<br>
<br>
SELECT setval(oid, nextval(oid), false) FROM pg_class WHERE relkind
= 'S'<br>
<br>
and my initial experiments suggest it does.<br>
<br>
Sean<br>
</body>
</html>