Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么在PostgreSQL查询日志中不显示前置和追加的注释?_Postgresql - Fatal编程技术网

为什么在PostgreSQL查询日志中不显示前置和追加的注释?

为什么在PostgreSQL查询日志中不显示前置和追加的注释?,postgresql,Postgresql,我正在使用PostgreSQL 9.6.12,希望记录所有查询。在研究了如何做到这一点之后,我更新了postgresql.conf文件并重新启动了postgres: logging_collector = on log_directory = 'pg_log' log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' log_min_error_statement = error log_min_duration_statement = 0 它工作正常,并

我正在使用PostgreSQL 9.6.12,希望记录所有查询。在研究了如何做到这一点之后,我更新了postgresql.conf文件并重新启动了postgres:

logging_collector = on
log_directory = 'pg_log'
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
log_min_error_statement = error
log_min_duration_statement = 0
它工作正常,并且在/var/lib/postgresql/data/pg_log/postgresql-%Y-%m-%d_%H%m%S.log中有记录的查询,但是当我在查询的开头或结尾添加注释时,它不会显示在日志文件中

示例查询:

/* This comment is not shown in logs */ SELECT * FROM example;

注释只在日志插入到查询的中间时显示:

SELECT * FROM /* This comment is shown in logs */ example;

您如何提交这些查询?无论使用哪个库连接到数据库,都可能在将注释发送到数据库之前剥离掉这些注释,因此数据库无法访问它们。如果我直接使用psql或Perl的DBD::Pg提交查询,它们会按预期工作。

谢谢,这才是真正的问题所在。我使用Intellij IDEA执行查询,显然它会删除我的注释。使用psql,它工作得很好