Re: [HACKERS] fix hard-coded index in make_partition_op_expr - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [HACKERS] fix hard-coded index in make_partition_op_expr
Date
Msg-id CA+TgmoYXYjO6=KVw6VTrxnLsymgxR7dr3QFfsAyAcJJjZrT0eQ@mail.gmail.com
Whole thread Raw
In response to [HACKERS] fix hard-coded index in make_partition_op_expr  (Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>)
Responses Re: [HACKERS] fix hard-coded index in make_partition_op_expr  (Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>)
Re: [HACKERS] fix hard-coded index in make_partition_op_expr  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
On Wed, May 17, 2017 at 5:38 AM, Jeevan Ladhe
<jeevan.ladhe@enterprisedb.com> wrote:
> While browsing through the partitioning code, I noticed that a recent commit
> f8bffe9e6d700fd34759a92e47930ce9ba7dcbd5, which fixes multi-column range
> partitioning constraints, introduced a function make_partition_op_expr, that
> takes keynum as a input parameter to identify the index of the partition
> key.
> In case of range partition we can have multiple partition keys but for list
> partition we have only one. Considering that, I think following code does
> not
> cause any side-effect logically(and may be a oversight while moving the code
> from function get_qual_for_list to this function):
>
> saopexpr->inputcollid = key->partcollation[0];
> saopexpr->args = list_make2(arg1, arg2);
>
> But as we have keynum now, should we be using it to index
> key->partcollation,
> instead of a hard coded '0'.

Agreed.  Committed your patch.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgindent (was Re: [HACKERS] [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.)
Next
From: Tom Lane
Date:
Subject: Re: pgindent (was Re: [HACKERS] [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.)