1

ダンプしたテーブルを現在の場所に復元しようとしています。テーブルは次を使用してダンプされました。

pg_dump -t table db > table.sql -U username

復元しようとして、私は使用しています:

pg_restore -c --dbname=db --table=table table.sql

テーブルが現在存在し、データがあるため、-c を使用していますが、次のように返されます。

pg_restore: [archiver] input file appears to be a text format dump. Please use psql.

私も試しました:

-bash-4.2$ psql -U username -d db -1 -f table.sql

しかし、データは既に存在--cleanし、この psql コマンドにはオプションがないため (私は信じています)、以下を返します。

psql:table.sql:32: ERROR:  relation "table" already exists

pg_restore を正しく使用する方法、または --clean オプションを指定して psql を使用する方法はありますか?

4

1 に答える 1