" does not exist,,postgresql,postgresql-9.6,pg-restore"/>

首页 > 解决方案 > Trying to pg_restore from a pg_dump file, FOREIGN TABLEs are causing probems: ERROR: server "" does not exist,

问题描述

Here is the output from the log. This happens hundreds of times then it hangs.

Command I'm running:

pg_restore -h $upgrade_db_host -U $upgrade_db_user -d $upgrade_db_name --no-privileges --no-owner --clean feb20_full_backup.sql

the backup file is created by

pg_dump -U $db_user -h $db_host -d $db_name -Fc > file_name.sql

And then the error

pg_restore: [archiver (db)] Error from TOC entry 714; 1259 787746527 FOREIGN TABLE user_auths fake_schema
pg_restore: [archiver (db)] could not execute query: ERROR:  server "suinfo_database_server2" does not exist
    Command was: CREATE FOREIGN TABLE startupinfo.user_auths (
    id integer NOT NULL,
    user_id integer,
    authentication_p...

I've tried searching for errors related to "server does not exist" and Foreign Table stuff specifically, but haven't found anything that works.

Anything I am missing to get pg_restore to handle foreign tables?

标签: postgresqlpostgresql-9.6pg-restore

解决方案


推荐阅读