Here is an updated version of contrib/pg_stat_statements module. I wrote: > A shutdown hook is probably not needed because I can use proc_exit() > or shmem_exit() for the purpose.
I added shutdown hook eventually because MyProc has been reset already in on_shmem_exit(). A callback that resets MyProc is registered to on_shmem_exit after shared_preload_libraries are loaded and callbacks are called in order of LIFO. Attached files are: * startup+shutdown_hooks-1027.patch The patch modifies corecode in the 3 points: - startup_hook: Called on server startup by startup process where LoadFreeSpaceMap() in 8.3 had been called. - shutdown_hook: Called on server shutdown by bgwriter where DumpFreeSpaceMap() in 8.3 had been called. - shared_preload_libraries are loaded by auxiliary processes: Windows port requires it. * pg_stat_statements-1027.tgz The pg_stat_statements contrib module. It requires patches startup+shutdown_hooks-1027.patch (above) and auto_explain.patch ( http://archives.postgresql.org/message-id/[EMAIL PROTECTED] ) . Now it dumps statistics into file at server shutdown and load it at the next restart. The default path of the saved file is 'global/pg_stat_statements.dump'. * pgstatstatements.sgml Documentation of the module. Regards, --- ITAGAKI Takahiro NTT Open Source Software Center
pg_stat_statements-1027.tgz
Description: Binary data
pgstatstatements.sgml
Description: Binary data
startup+shutdown_hooks-1027.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers