Skip site navigation (1) Skip section navigation (2)

Re: Second thoughts on CheckIndexCompatible() vs.operator families

From: Noah Misch <noah(at)leadboat(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Second thoughts on CheckIndexCompatible() vs.operator families
Date: 2012-01-26 02:51:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Wed, Jan 25, 2012 at 03:32:49PM -0500, Robert Haas wrote:
> On Sun, Jan 22, 2012 at 12:23 AM, Noah Misch <noah(at)leadboat(dot)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 value the savings in vertical space more than the lost idiomaticness.  This
decision is 90+% subjective, so I cannot blame you for concluding otherwise.
I do know the feeling of looking at PostgreSQL source code and wishing the
author had not attempted to conserve every line.

In response to

pgsql-hackers by date

Next:From: Noah MischDate: 2012-01-26 03:39:56
Subject: Re: Avoid FK validations for no-rewrite ALTER TABLEALTER TYPE
Previous:From: Noah MischDate: 2012-01-26 02:47:29
Subject: Re: Measuring relation free space

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group