Yeah, it really is quite a mess. I tried to review your patch, and I think it's correct, but I couldn't totally convince myself, because of the existing messiness of the logic.
So I bit the bullet and started refactoring.
I came up with the attached. It refactors the logic in doCustom() into a state machine.
Sounds good! This can only help.
I think this is much clearer, what do you think?
I think that something was really needed. I'm going to review and test this patch very carefully, probably over next week-end, and report.
-- Fabien. -- Sent via pgsql-hackers mailing list (firstname.lastname@example.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers