0

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

有什么建议么?

 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
4

1 回答 1

1

如果 OpenERP 在连接时使用了特定的角色(示例中使用了“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]);
于 2013-08-14T22:33:30.423 回答