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

From David Rowley
Subject Re: Incorrect comment in get_partition_dispatch_recurse
Date
Msg-id CAKJS1f_VwEYVOb_iNwjUbGPjEYKrtXoHkBnwNbw6ZQ506UCRyg@mail.gmail.com
Whole thread Raw
In response to Re: Incorrect comment in get_partition_dispatch_recurse  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
On 17 May 2018 at 13:17, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote:
> Or maybe, change the comment to say that even the negative indexes are
> 0-based like you pointed out, *but* instead of updating the comment like
> you suggest above, change the other index value assignment statement to
> not subtract 1 from the list_length by switching order with the
> accompanying lappend; like this:
>
>          if (get_rel_relkind(partrelid) != RELKIND_PARTITIONED_TABLE)
>          {
> +            pd->indexes[i] = list_length(*leaf_part_oids);
>              *leaf_part_oids = lappend_oid(*leaf_part_oids, partrelid);
> -            pd->indexes[i] = list_length(*leaf_part_oids) - 1;
>          }
>          else
>          {

That makes sense.  It's probably less confusing that way.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Removing unneeded self joins
Next
From: Amit Langote
Date:
Subject: partition -> partitioned