Re: Second thoughts on CheckIndexCompatible() vs. operator families - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Second thoughts on CheckIndexCompatible() vs. operator families
Date
Msg-id 20628.1327553590@sss.pgh.pa.us
Whole thread Raw
In response to Re: Second thoughts on CheckIndexCompatible() vs. operator families  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Second thoughts on CheckIndexCompatible() vs. operator families  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Excerpts from Robert Haas's message of mié ene 25 17:32:49 -0300 2012:
>> On Sun, Jan 22, 2012 at 12:23 AM, Noah Misch <noah@leadboat.com> wrote:
> New version that repairs a defective test case.
>> 
>> Committed.  I don't find this to be particularly good style:
>> 
>> +       for (i = 0; i < old_natts && ret; i++)
>> +               ret = (!IsPolymorphicType(get_opclass_input_type(classObjectId[i
>> +                          irel->rd_att->attrs[i]->atttypid == typeObjectId[i]);
>> 
>> ...but I am not sure whether we have any formal policy against it, so
>> I just committed it as-is for now.  I would have surrounded the loop
>> with an if (ret) block and written the body of the loop as if
>> (condition) { ret = false; break; }.

> I find that code way too clever.

Not only is that code spectacularly unreadable, but has nobody noticed
that this commit broke the buildfarm?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: WAL Restore process during recovery
Next
From: Fujii Masao
Date:
Subject: Re: Avoiding shutdown checkpoint at failover