首页 > 解决方案 > 手动启动 PostgreSQL 服务器并设置详细模式以查看所有查询

问题描述

手动启动 postgresql 服务器时,是否有详细模式可以在终端控制台中获取在 PostgreSQL 服务器上执行的查询列表?如果是,如何使用?

我在 macos 上以这种方式启动 PostgreSQL 服务器:

/Applications/Postgres.app/Contents/Versions/12/bin/postgres -D "/Users/me/Library/Application Support/Postgres/var-12" -p 5432

标签: postgresqlmacos

解决方案


您可以log_statement=all在 postgresql.conf 中或在bin/postgres命令行中使用-c.


推荐阅读