Re: Needless additional partition check in INSERT? - Mailing list pgsql-hackers

From Amit Langote
Subject Re: Needless additional partition check in INSERT?
Date
Msg-id 26e90dc4-9023-7b0d-67c1-5604e4bcd6f3@lab.ntt.co.jp
Whole thread Raw
In response to Re: Needless additional partition check in INSERT?  (Amit Khandekar <amitdkhan.pg@gmail.com>)
Responses Re: Needless additional partition check in INSERT?  (David Rowley <david.rowley@2ndquadrant.com>)
List pgsql-hackers
On 2018/05/11 18:43, Amit Khandekar wrote:
> This looks better (it will avoid unnecessary ExecConstraints() call) :
> 
> if (resultRelInfo->ri_PartitionRoot == NULL ||
>      (resultRelInfo->ri_TrigDesc &&
>       resultRelInfo->ri_TrigDesc->trig_insert_before_row))
>     check_partition_constr = resultRelInfo->ri_PartitionCheck;

You'd be assigning a List pointer to a bool variable with this.  Maybe you
meant:

    check_partition_constr = (resultRelInfo->ri_PartitionCheck != NIL);

Thanks,
Amit



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Compiler warnings with --enable-dtrace
Next
From: Ashutosh Bapat
Date:
Subject: Re: Expression errors with "FOR UPDATE" and postgres_fdw withpartition wise join enabled.