首页 > 解决方案 > postgrest `stack test` 给出:致命:数据库“test/create_test_db”postgres://postgres:pwd@database-host“tes”不存在

问题描述

stack test给出错误:

postgrest> test (suite: spec)

psql: warning: extra command-line argument "-f" ignored
psql: warning: extra command-line argument "test/fixtures/database.sql" ignored
psql: FATAL:  database "test/create_test_db "postgres://postgres:pwd@database-host" tes" does not exist
spec.exe: readCreateProcess: psql "--set" "ON_ERROR_STOP=1" "test/create_test_db \"postgres://postgres:pwd@database-host\" test_db" "Trader" "-f" "test/fixtures/database.sql" (exit 2): failed

postgrest> Test suite spec failed
Test suite failure for package postgrest-6.0.2
    spec:  exited with: ExitFailure 1
Logs printed to console

我在 Windows10 上,并设置了系统环境变量 POSTGREST_TEST_CONNECTION:

test/create_test_db "postgres://postgres:pwd@database-host" test_db

psql在终端给出

psql (11.5)
WARNING: Console code page (437) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.
Type "help" for help.

Trader=#

标签: postgrest

解决方案


推荐阅读