I wrote:
> bricklen <bricklen(at)gmail(dot)com> writes:
>> Is this a bug,
> Yes. Thanks for the test case, will look.
Fixed, patch is at
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=1679e9feddc94bd7372a6829db92868e55ef7177
regards, tom lane