Hello,
Per idea of Nikolay Samokhvalov[1] I propose this patch to add the possibility
to log all statements from a fraction of transactions.
I have several questions:
* Do we want this feature?
* How can I add tests? I seems hard to handle tests when a there is duration
in the output.
* Should I handle the case when someone try to change the setting *inside* a
transaction:
# SET client_min_messages to LOG;
SET
# SET log_transaction_sample_rate to 1;
SET
# BEGIN;
LOG: duration: 0.364 ms statement: BEGIN;
BEGIN
# SELECT 1;
LOG: duration: 0.530 ms statement: SELECT 1;
-[ RECORD 1 ]
?column? | 1
# SET log_transaction_sample_rate to 0;
LOG: duration: 0.333 ms statement: SET log_transaction_sample_rate to 0;
SET
# SELECT 1;
LOG: duration: 0.586 ms statement: SELECT 1;
-[ RECORD 1 ]
?column? | 1
Thanks
[1]:
https://www.postgresql.org/message-id/CANNMO%2BLg65EFqHb%2BZYbMLKyE2y498HJzsdFrMnW1dQ6AFJ3Mpw%40mail.gmail.com
--
Adrien NAYRAT