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

[kagemai-users:0524] Re: 保存形式がPostgresの場合、添付ファイルがバックアップできない。



椴木です。

>  # pg_dump -F t -b -o (データベース名) > (バックアップデータベース名);

ご回答ありがとうございます。
このコマンドでバックアップデータにバイナリデータが付加されていること
が確認できました。ですが、データベースの復旧でうまくいかず、いまだ
添付ファイルのファイルサイズが0バイトになってしまってます。

コマンドは次のように打ちました。

#pg_dump -Ft -b -o (データベース名) > (バックアップデータベース名)
#dropdb (データベース名)
#createdb (データベース名)
#pg_restore -d (データベース名) (バックアップデータベース名)

すると、次のようにメッセージが出力されます。

------------------------------------------------------------------------
pg_restore: NOTICE:  CREATE TABLE will create implicit sequence 
"reports_id_seq" for "seri
al" column "reports.id"
pg_restore: NOTICE:  CREATE TABLE will create implicit sequence 
"messages_id_seq" for "ser
ial" column "messages.id"
pg_restore: NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit 
index "reports_pke
y" for table "reports"
pg_restore: NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit 
index "messages_pk
ey" for table "messages"
pg_restore: NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit 
index "attachments
_pkey" for table "attachments"
----------------------------------------------------------------------

この状態で影舞にアクセスすると、添付ファイルのみが復旧できません。
restore時に-oオプションを追加すると、エラーメッセージが出力され、
データベースの復旧までも失敗してしまいます。

#pg_restore -o -d (データベース名) (バックアップデータベース名)

------------------------------------------------------------------------
pg_restore: [archiver (db)] could not execute query: ERROR:  relation 
"reports_id_seq" doe
s not exist
-----------------------------------------------------------------------

基本的なところでミスをしているかと思うのですが、どこが間違っているか教
えて頂けませんでしょうか?

よろしくお願いいたします。