使用pg_dump导出postgres db不起作用,数据库“db_name”不存在

问题描述 投票:0回答:1

我试图使用pg_dump命令导出PostgreSQL数据库(db name ari_company):

C:\Program Files (x86)\PostgreSQL\10\bin>pg_dump --no-owner -U postgres ari_company> dump.sql

然后我收到了这个错误:

pg_dump: [archiver (db)] connection to database "ari_company" failed: FATAL:  database "ari_company" does not exist

但是当我运行默认数据库(postgres)时,它可以工作并创建dump.sql。用命令

psql\l
i checked which db exist and there is postgres and my created ari_company. what im doing wrong here ?
postgresql pg-dump
1个回答
0
投票

问题是我有两个已安装的服务器,但连接到没有命名数据库的错误服务器。数据库postgres在两台服务器上都会退出,因为它是自动创建的,其名称与您为用户名设置的名称相同

© www.soinside.com 2019 - 2024. All rights reserved.