Hi all,I don't know how much is effective or if it's applicableto postgresql processe but it's an interesting article:
http://www.onlamp.com/pub/a/onlamp/2004/10/28/design_by_contract_in_c.html
RegardsGaetano Mendola