捕获表上发生的变化?

时间:2013-08-14 20:26:02

标签: postgresql openerp

我想看看PostgreSQL中的哪些表和字段,OpenERP中的模块在运行时正在更改/更新。

有什么建议吗?

 application_name           | pgAdmin III - Query Tool   | client
 bytea_output               | escape                     | session
 client_encoding            | UNICODE                    | session
 client_min_messages        | notice                     | session
 DateStyle                  | ISO,MDY                    | session
 default_text_search_config | pg_catalog.english         | configuration file
 lc_messages                | English_United States.1252 | configuration file
 lc_monetary                | English_United States.1252 | configuration file
 lc_numeric                 | English_United States.1252 | configuration file
 lc_time                    | English_United States.1252 | configuration file
 listen_addresses           | *                          | configuration file
 log_destination            | csvlog                     | configuration file
 log_line_prefix            | %t                         | configuration file
 log_timezone               | US/Pacific                 | configuration file
 logging_collector          | on                         | configuration file
 max_connections            | 100                        | configuration file
 max_stack_depth            | 2MB                        | environment variable
 port                       | 5432                       | configuration file
 shared_buffers             | 32MB                       | configuration file
 TimeZone                   | US/Pacific                 | configuration file

1 个答案:

答案 0 :(得分:1)

如果OpenERP在连接时使用特定的ROLE(在示例中使用“openerp”),则可以通过几种不同的方式记录语句:

1)。 ALTER ROLE openerp SET log_min_duration_statement TO 0;

2)。 ALTER ROLE openerp SET log_statement TO 'mod';

我的偏好是选项#1,但你可能想尝试两种方式。

要将设置恢复为默认值:

1)。 ALTER ROLE openerp SET log_min_duration_statement TO DEFAULT;

2)。 ALTER ROLE openerp SET log_statement TO DEFAULT; - 或'none'

要查看当前设置是什么(未通过ROLE设置时),请粘贴以下查询的结果:

SELECT  name, 
        current_setting(name) AS current_setting, 
        source
FROM pg_settings
WHERE source <> ALL (ARRAY['default'::text, 'override'::text]);