に.sql
データベースダンプをインポートしようとしています。私はコマンドラインとPosticoのGUIで試しましたが、インポート時に何千ものエラーのようなエラーが発生します。postgresのSQLダンプインポートで多くの構文とアクセス許可のエラーが発生しました
SQLダンプは、postgres 9.4.5
を実行している同僚からのものであり、SQLが有効に見えます。
私のPostgresのバージョン:アップル社に基づき のi686-りんごdarwin11-LLVM-GCC-4.2でコンパイルx86_64版 - リンゴ - ダーウィン、(GCC)4.2.1(上
のPostgreSQL 9.6.1 。 ビルド5658)(LLVM 2336.11.00を構築)、64ビットのIは、以下の輸入しようとした
:
psql -U postgres dbname < ~/Desktop/dbname_local_db_20161122.sql
は次にログインし、それをしよう:
psql -U postgres dbname
dbname=# \i ~/Desktop/dbname_local_db_20161122.sql
エラー:(これ以外の方法よりあります)
Password for user postgres:
SET
SET
SET
SET
SET
SET
CREATE EXTENSION
COMMENT
ERROR: schema "public" does not exist
ERROR: extension "citext" does not exist
ERROR: schema "public" does not exist
ERROR: extension "pg_trgm" does not exist
SET
ERROR: function "add_session_metric" already exists with same argument types
ERROR: role "myrole" does not exist
ERROR: function "session_metrics_partition_creation" already exists with same argument types
ERROR: role "myrole" does not exist
ERROR: function "session_metrics_partition_function" already exists with same argument types
ERROR: role "myrole" does not exist
SET
SET
ERROR: permission denied to create "pg_catalog.messages"
DETAIL: System catalog modifications are currently disallowed.
ERROR: relation "messages" does not exist
ERROR: permission denied to create "pg_catalog.Message_id_seq"
DETAIL: System catalog modifications are currently disallowed.
ERROR: relation "Message_id_seq" does not exist
ERROR: relation "Message_id_seq" does not exist
ERROR: permission denied to create "pg_catalog.sessions_users"
invalid command \N
invalid command \N
invalid command \N
invalid command \N
invalid command \N
invalid command \.
ERROR: syntax error at or near "2"
LINE 1: 2 hello 3 1 2015-11-12 09:25:14.646-07 2015-11-12 09:25:14.64...
ERROR: syntax error at or near "1"
LINE 1: 1
^
ERROR: relation "external_session_info_sessions" does not exist
invalid command \.
ERROR: syntax error at or near "2528"
LINE 1: 2528 1
^
invalid command \.
ERROR: relation "feedback_id_seq" does not exist
LINE 1: SELECT pg_catalog.setval('feedback_id_seq', 1, false);
私が言ったように、SQLファイルルックス有効です。 9.4.5
から9.6.1
への互換性の問題を確認しましたが、表示されません。
私はPERMISSION DENIED
を見んが、私は、スーパーユーザー権限を持つユーザーpostgres
などのコマンドを実行しています: