Andrew Dunstan <andrew(at)dunslane(dot)net> writes:> OK, here 'tis.
Looks fairly reasonable to me, but of course I haven't tested it.
regards, tom lane