我想知道是否可以仅在 PostgreSQL 中为特定表启用日志记录(即使用表级粒度进行日志记录)?
目前正在以下列方式打印日志。如果我们像这样启用完整的日志记录,分配的 HDD 空间将在不到 30 分钟内被吃光。
GMT_jbpm_LOG: 00000: duration: 0.104 ms bind <unnamed>: select instances0_.PROCESSINSTANCE_ as PROCESSI4_1_, instances0_.ID_ as ID1_1_, instances0_.NAME_ as NAME6_1_, instances0_.ID_ as ID1_54_0_, instances0_.VERSION_ as VERSION3_54_0_, instances0_.PROCESSINSTANCE_ as PROCESSI4_54_0_, instances0_.TASKMGMTDEFINITION_ as TASKMGMT5_54_0_, instances0_.CLASS_ as CLASS2_54_0_ from JBPM_MODULEINSTANCE instances0_ where instances0_.PROCESSINSTANCE_=$1
2013-03-27 09:42:09.039 GMT_jbpm_DETAIL: parameters: $1 = '9646163'
2013-03-27 09:42:09.039 GMT_jbpm_LOCATION: exec_bind_message, postgres.c:1784
2013-03-27 09:42:09.039 GMT_amq_LOG: 00000: duration: 0.023 ms
2013-03-27 09:42:09.039 GMT_amq_LOCATION: exec_execute_message, postgres.c:1988
2013-03-27 09:42:09.039 GMT_jbpm_LOG: 00000: execute <unnamed>: select instances0_.PROCESSINSTANCE_ as PROCESSI4_1_, instances0_.ID_ as ID1_1_, instances0_.NAME_ as NAME6_1_, instances0_.ID_ as ID1_54_0_, instances0_.VERSION_ as VERSION3_54_0_, instances0_.PROCESSINSTANCE_ as PROCESSI4_54_0_, instances0_.TASKMGMTDEFINITION_ as TASKMGMT5_54_0_, instances0_.CLASS_ as CLASS2_54_0_ from JBPM_MODULEINSTANCE instances0_ where instances0_.PROCESSINSTANCE_=$1
2013-03-27 09:42:09.039 GMT_jbpm_DETAIL: parameters: $1 = '9646163'
2013-03-27 09:42:09.039 GMT_jbpm_LOCATION: exec_execute_message, postgres.c:1918
2013-03-27 09:42:09.039 GMT_jbpm_LOG: 00000: duration: 0.053 ms
2013-03-27 09:42:09.039 GMT_jbpm_LOCATION: exec_execute_message, postgres.c:1988
2013-03-27 09:42:09.039 GMT_bnw_LOG: 00000: duration: 0.068 ms parse <unnamed>: select workflowde0_.workflow_definition_id as workflow1_14_0_, workflowde0_.created as created14_0_, workflowde0_.deleted as deleted14_0_, workflowde0_.name as name14_0_, workflowde0_.version as version14_0_, workflowde0_.workspace_id as workspace6_14_0_ from workflow_definition workflowde0_ where workflowde0_.workflow_definition_id=$1
2013-03-27 09:42:09.039 GMT_bnw_LOCATION: exec_parse_message, postgres.c:1367
2013-03-27 09:42:09.039 GMT_bnw_LOG: 00000: duration: 0.059 ms parse <unnamed>: update worker set created=$1, deleted=$2, name=$3, full_name=$4, worker_type=$5, max_jobs_in_progress=$6, max_jobs_queued=$7, jobs_queued=$8, workspace_id=$9 where worker_id=$10
2013-03-27 09:42:09.039 GMT_bnw_LOCATION: exec_parse_message, postgres.c:1367
2013-03-27 09:42:09.039 GMT_bnw_LOG: 00000: duration: 0.077 ms bind <unnamed>: select workflowde0_.workflow_definition_id as workflow1_14_0_, workflowde0_.created as created14_0_, workflowde0_.deleted as deleted14_0_, workflowde0_.name as name14_0_, workflowde0_.version as version14_0_, workflowde0_.workspace_id as workspace6_14_0_ from workflow_definition workflowde0_ where workflowde0_.workflow_definition_id=$1
2013-03-27 09:42:09.039 GMT_bnw_DETAIL: parameters: $1 = '7089580'
我想做的是为名为worker
table 的表启用日志记录,但避免记录有关我数据库中任何其他表的事件。
重申一下 - PostgreSQL 中是否有任何方法可以仅记录特定表的信息?
UPDATE worker SET created=$1, deleted=$2, name=$3;