更新时间:2022-11-30 09:42:58
此处所需的特殊关键字是主机
:
The special keyword needed here is host
:
DATABASE_URL=postgres://user:password@/dbname?host=/path/to/db
请注意,主机中的路径
应该是路径,而不是套接字文件本身(psycopg2假定套接字具有标准命名约定 .s.PGSQL.5432
)
Note that the path in host
should be a path, not the socket file itself (psycopg2 assumes the socket has the standard naming convention .s.PGSQL.5432
)
https://docs.sqlalchemy.org/en/latest/dialects/postgresql.html#unix -domain-connections