1
我從arelle.org下載了xbrldb_SEC_pg_2014-11-02.pg.gzip postgres pg_dump文件。然後我跑pgAdminIII模式DDL文件,並重新創建所有的數據庫,功能等如何使用psql從gzip文件恢復postgres數據庫? (arelle:XBRL SEC DB)
當我嘗試使用還原的數據庫執行以下操作:
desktop:~/Downloads$ sudo postgres zcat xbrldb_SEC_pg_2014-11-02.pg.gzip | psql -U postgres public
我得到:
sudo: postgres: command not found psql: FATAL: Peer authentication failed for user "postgres"
我可以將該文件放入一個文件中以展開它。看起來它是一個pg_dump文件。
postgres=> pg_restore -a /home/jeremy/Downloads/xbrldb_SEC_pg_2014-11-02.txt
postgres-> ;
ERROR: syntax error at or near "pg_restore"
LINE 1: pg_restore -a /home/jeremy/Downloads/xbrldb_SEC_pg_2014-11-0...
^
postgres=> pg_restore -a postgres /home/jeremy/Downloads/xbrldb_SEC_pg_2014-11-02.txt;
ERROR: syntax error at or near "pg_restore"
LINE 1: pg_restore -a postgres /home/jeremy/Downloads/xbrldb_SEC_pg_...
於是我試圖用PG管理員III,和我的輸出:
/usr/bin/pg_restore --host localhost --port 5432 --username "postgres" --dbname "public" --role "postgres" --no-password --section data --data-only --exit-on-error --table accession --schema public --verbose "/home/jeremy/Downloads/xbrldb_SEC_pg_2014-11-02.backup"
pg_restore: [archiver] input file appears to be a text format dump. Please use psql.
進程返回退出代碼1.
我可以請你什麼,我需要做的就是在數據庫恢復?
有誰知道我需要做什麼才能使數據庫從2014-11-02更新到當前日期?