Konstantin Knizhnik writes:
> On 04/12/2024 9:03 am, Tom Lane wrote:
>> Konstantin Knizhnik writes:
>>> postgres=# create table t(x integer unique);
>>> CREATE TABLE
>>> postgres=# insert into t values (null),(null);
>>> INSERT 0 2
>>> postgres=# select count(distinct x) from t;
>>> count
>>>
On Tuesday, December 3, 2024, Konstantin Knizhnik
wrote:
>
> Is it only me who consider that current behavior of array_agg(distinct)
> contradicts to interpretation of nulls in other cases ("null" is something
> like "unknown" which means that we can not say weather two nulls are the
> same or not
On 04/12/2024 9:03 am, Tom Lane wrote:
Konstantin Knizhnik writes:
postgres=# create table t(x integer unique);
CREATE TABLE
postgres=# insert into t values (null),(null);
INSERT 0 2
postgres=# select count(distinct x) from t;
count
---
0
(1 row)
postgres=# select array_agg(dist
Konstantin Knizhnik writes:
> postgres=# create table t(x integer unique);
> CREATE TABLE
> postgres=# insert into t values (null),(null);
> INSERT 0 2
> postgres=# select count(distinct x) from t;
> count
> ---
> 0
> (1 row)
> postgres=# select array_agg(distinct x) from t;
> array