Re: Unexpected (wrong?) result querying boolean partitioned table with NULL partition
| От | Richard Guo | 
|---|---|
| Тема | Re: Unexpected (wrong?) result querying boolean partitioned table with NULL partition | 
| Дата | |
| Msg-id | CAMbWs49OLBVCwuq7ucCio1x-x7DaaF+c5NkT=ZDOpwodFXPRkg@mail.gmail.com обсуждение исходный текст  | 
		
| Ответ на | Re: Unexpected (wrong?) result querying boolean partitioned table with NULL partition (Richard Guo <guofenglinux@gmail.com>) | 
| Ответы | 
                	
            		Re: Unexpected (wrong?) result querying boolean partitioned table with NULL partition
            		
            		 | 
		
| Список | pgsql-hackers | 
On Thu, Apr 13, 2023 at 10:39 AM Richard Guo <guofenglinux@gmail.com> wrote:
On Wed, Apr 12, 2023 at 7:13 PM David Rowley <dgrowleyml@gmail.com> wrote:There's already code to effectively handle <> operators. Just the
PartClauseInfo.op_is_ne needs to be set to true.
get_matching_list_bounds() then handles that by taking the inverse of
the partitions matching the equality operator.
Effectively, I think that's the attached patch.I think there is a thinko here.
Sorry.  It's my thinko.  In cases IS_NOT_TRUE and IS_NOT_FALSE the
op_is_ne is set to true. So the logic in origin patch is right.
BTW, I wonder if we should elog an Error here.
default:
- Assert(false); /* hmm? */
- return PARTCLAUSE_UNSUPPORTED;
+ elog(ERROR, "unrecognized booltesttype: %d",
+ (int) btest->booltesttype);
+ break;
Otherwise the patch looks good to me.
Thanks
Richard
op_is_ne is set to true. So the logic in origin patch is right.
BTW, I wonder if we should elog an Error here.
default:
- Assert(false); /* hmm? */
- return PARTCLAUSE_UNSUPPORTED;
+ elog(ERROR, "unrecognized booltesttype: %d",
+ (int) btest->booltesttype);
+ break;
Otherwise the patch looks good to me.
Thanks
Richard
В списке pgsql-hackers по дате отправления: