[pgcluster: 638] Re: pg_restoreをすると、レプリケーションサーバが反応しなくなる

mitani mitani @ sraw.co.jp
2005年 1月 7日 (金) 16:38:16 JST


三谷@広島です.

> pgcluster-1.0.8bで早速試してみましたが、うまくいかないです.
そうですか...
こちらでも(Solaris 8は手元に無いので)Solaris 9で試してみました.
結果はOKでした.

ClusterDBはポート番号(5001,5002,5003)を変えて3台で試しました.
----------------結果----------------
[postgres @ post1 postgres]$ uname -a
SunOS post1 5.9 Generic_112234-07 i86pc i386 i86pc
[postgres @ post1 postgres]$ createuser -p 5001 test
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) y
CREATE USER
[postgres @ post1 postgres]$ createdb -p 5001 --owner=test test
CREATE DATABASE
[postgres @ post1 postgres]$ pg_restore -p 5001 -d test -U test test.out
pg_restore: NOTICE:  CREATE TABLE will create implicit sequence 'test_id_seq' fo
r SERIAL column 'test.id'
[postgres @ post1 postgres]$ psql -p 5003 test
Welcome to psql 7.3.8, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

test=# select * from test;
 id |             tm
----+----------------------------
  1 | 2005-01-06 16:14:29.382372
  2 | 2005-01-06 16:14:30.817464
  3 | 2005-01-06 16:14:31.419702
  4 | 2005-01-06 16:14:31.990771
(4 rows)

test=# \q

高橋さんのレプリケーションのログを見ると,クラスタDBが1台の時でも,
COPYのデータ部が出てこないようですね.

> DEBUG:PGRdo_replicate():query :: COPY test (id, name) FROM stdin
<中略>
> DEBUG:PGRdo_replicate():query ::

私の環境下では以下のようにデータ部が表示されています.

DEBUG:PGRdo_replicate():query :: COPY test (id, tm) FROM stdin
<中略>
DEBUG:PGRdo_replicate():query :: 1      2005-01-06 16:14:29.382372
2       2005-01-06 16:14:30.817464
3       2005-01-06 16:14:31.419702
4       2005-01-06 16:14:31.990771
\.

ちなみに,pg_restoreを使わない場合はどうなりますか?
------------pg_dump + psqlの組み合わせ-------------
[postgres @ post1 postgres]$ pg_dump -p 5001 test > test.dmp
[postgres @ post1 postgres]$ dropdb -p 5001 test
DROP DATABASE
[postgres @ post1 postgres]$ createdb -p 5001 test
CREATE DATABASE
[postgres @ post1 postgres]$ psql -p 5001 test < test.dmp
You are now connected as new user postgres.
SET
NOTICE:  CREATE TABLE will create implicit sequence 'test_id_seq' for SERIAL col
umn 'test.id'
CREATE TABLE
 setval
--------
      4
(1 row)

この方法ではどうなりますでしょうか?

=============================
三谷 篤<mitani @ sraw.co.jp>
=============================




pgcluster メーリングリストの案内