[check_postgres] Fix query_time action for PostgreSQL < 8.3

Jehan-Guillaume (ioguix) de Rorthais jgdr at dalibo.com
Wed Dec 29 10:40:29 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

With 2.15.2, action query_time is not compatible anymore with PostgreSQL < 8.3.

After some investigation, it appears the function "find_pg_stat_activity" has
been introduced to factorize actions txn_idle, txn_time and query_time (per
comment in it).
However it is only used with the query_time action and breaks it for PostgreSQL
< 8.3 because of unkonwn column xact_start.

As there is no global mechanism to test the backend version and write the query
accordingly, I preferred to remove this function and rewrite the action itself.

PFA a patch to apply using 'git am'.

Note that the patch is also available from:
  https://github.com/dalibo/check_postgres/tree/dalibo

I you accept this patch, I can send you a pull request from github as well.

Thanks.
- -- 
Jehan-Guillaume de Rorthais
DBA
http://www.dalibo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0bEBwACgkQXu9L1HbaT6IiFgCcD4rWsja9+TkTMlHoTcaGmG09
gRsAn0gmAqrBr20gN8MObRXH8WPzlc+c
=Xno3
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-query_time-action-for-PostgreSQL-8.3.patch
Type: text/x-diff
Size: 11804 bytes
Desc: not available
Url : https://mail.endcrypt.com/pipermail/check_postgres/attachments/20101229/c56db586/attachment.bin 


More information about the Check_postgres mailing list