如何使用psql在URI中指定架构?
psql使用 URI连接到数据库时,我可以使用 URI 指定数据库:
psql postgres://user:pass@hostname/my_db
但是我如何指定模式?
回答
您可以使用options查询参数指定它:
psql "postgres://user:pass@hostname/my_db?options=--search_path%3Dmy_schema"
%3D是一个 URL 编码的=标志。它必须是 URL 编码的,否则psql会被混淆。