我有一小部分数据库作为转储来进行集成测试。我使用以下命令恢复它:
pg_restore --no-acl --no-owner --verbose --create -h localhost -p 5435 -j 4 -U $PG_USER -d test latest.dump
问题是在我看到的日志中:
pg_restore: connecting to database for restore
pg_restore: processing item 5308 ENCODING ENCODING
pg_restore: processing item 5309 STDSTRINGS STDSTRINGS
pg_restore: processing item 5310 DATABASE dlq8aimf0q2pf
pg_restore: creating DATABASE dlq8aimf0q2pf
pg_restore: connecting to new database "dlq8aimf0q2pf"
pg_restore: connecting to database "dlq8aimf0q2pf" as user "postgres"
如您所见,它尝试创建“dlq8aimf0q2pf”而不是我指定的“测试”。我能得到数据库名称吗?什么 ENV var 使用这个名称?