我试图在Ubuntu 22.04上的bash中向Postgr数据库传递密码.像这样:
export PGPASSWORD=postgrespw
当我试图在这样的应用程序中使用它们时:
(例如cjdb,一个处理上传到PostgreSQL数据库的程序,https://github.com/cityjson/cjdb:
可以在PGPASSWORD环境变量中指定密码.如果未指定,应用程序将提示输入密码.
)
cjdb import -H localhost -U postgres -d test -s cjdb -f src/cjdb/LoD2_326625712.jsonl
or like this: (martin, a program also handling some database function on PostgreSQL db)
martin --config config.yaml
我总是听到"密码丢失".
直接使用psql的工作原理很奇怪:
psql -U postgres testcjdb -h localhost
上述两个程序都明确声明它们支持使用env变量PGPASSWORD
How can I figure out if it's the programs fault (which I kind of don't believe), or if something is off with my bash terminal?