Hi! What do you think about using INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT and INSTR_TIME_GET_MILLISEC macros for timing calculations?
Also, have you thought about a way to trace existing (running) queries without directly instrumenting them? It would be much more usable for maintenance and support personnel, because in production environments you rarely could change query text directly. For the current state the most simple solution is switch tracing on and off by calling SQL function, and possibly switch tracing for prepared statement the same way, but not for any random query. I'll check the patch for the race conditions. -- Regards, Nikita Malakhov Postgres Professional The Russian Postgres Company https://postgrespro.ru/