Re: Incorrect comment in get_partition_dispatch_recurse - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Incorrect comment in get_partition_dispatch_recurse
Date
Msg-id 27511.1526566387@sss.pgh.pa.us
Whole thread Raw
In response to Re: Incorrect comment in get_partition_dispatch_recurse  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Incorrect comment in get_partition_dispatch_recurse  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: Incorrect comment in get_partition_dispatch_recurse  (David Rowley <david.rowley@2ndquadrant.com>)
Re: Incorrect comment in get_partition_dispatch_recurse  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Hang on, I can't be wrong (famous last words).  If the negative
> indexes were 0-based, that would mean that the first element of the
> list was referenced by -0, which obviously can't be true, because 0 =
> -0.  In other words, we can't be using 0-based indexing for both the
> positive and the negative values, because then 0 itself would be
> ambiguous.  It's got to be that -1 is the first element of the *pds
> list, which means -- AFAICS, anyway -- that the way I phrased it is
> correct.

> Unless the indexing system actually can't reference the first element
> of *pds, and -1 means the second element.  But then I think we need a
> more verbose explanation here.

Maybe what you need is a redesign.  This convention seems impossibly
confusing and hence error-prone.  What about using a separate bool to
indicate which list the index refers to?

            regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: lazy detoasting
Next
From: Tom Lane
Date:
Subject: Re: [PROPOSAL] Shared Ispell dictionaries