Re: Question on not-in and array-eq

2021-12-08 Thread Zhenghua Lyu
Thanks for your explanation. From: David G. Johnston Sent: Wednesday, December 8, 2021 11:39 PM To: Zhenghua Lyu Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Question on not-in and array-eq On Wed, Dec 8, 2021 at 8:15 AM Zhenghua Lyu mailto:z

Re: Question on not-in and array-eq

2021-12-08 Thread David G. Johnston
On Wed, Dec 8, 2021 at 8:15 AM Zhenghua Lyu wrote: > I run the SQL without array expr in other DBs(orcale, sqlite, ...), they > all behave > the same as Postgres. > > It seems a bit confusing for me that 'not in' and 'in' the same subquery > both return 0 > rows, but the table contains data. > B

Question on not-in and array-eq

2021-12-08 Thread Zhenghua Lyu
Hi, I run the following SQL in Postgres (14_STABLE), and got the results: zlyu=# create table t1(a int, b int); CREATE TABLE zlyu=# create table t2(a int, b int); CREATE TABLE zlyu=# insert into t1 values (null, 1); INSERT 0 1 zlyu=# insert into t2 values (1, 1); INSERT 0 1 zlyu=# select * from