On 01/13/2012 05:29 AM, Christopher Maujean wrote:
> Patch
> <http://archives.postgresql.org/message-id/4EDBEFBB.9070509@gmail.com>
>
>
> In reviewing the referenced patch, we found that it has no developer
> documentation and no regression tests. While it compiles and installs,
> there is nothing to tell us how to use (or test) it.
>
Thanks for reviewing!
I think the regression tests should be part of the module that uses
the hooks. Alas, there are none that we'd want to ship with Postgres
at this time.
The best I could offer for testing the hooks is a log forwarding module
I've been working on. Basically, what it does is that it installs the
hooks, looks at the message emitted by backend and if needed sends it
away via UDP. Available at: https://github.com/mpihlak/pg_logforward
To install, run "make install" and modify postgresql.conf to include:
shared_preload_libraries = 'pg_logforward'
logforward.target_names = 'jsonsrv'
logforward.jsonsrv_host = '127.0.0.1'
logforward.jsonsrv_port = 23456
Now, after restarting postgres, you could use "nc 23456 -u -l" to
receive the log. Alternatively use testing/test_logserver.py as a
log "server".
About documentation - it sure would be nice to have all the hooks
written up somewhere. Any suggestions as to where to put it?
regards,
Martin