pre-commit triggers

https://commitfest.postgresql.org/action/patch_view?id=1312
http://archives.postgresql.org/message-id/5286D6B1.4070706@dunslane.net