Re: GROUP BY using tablename.* does not work if tablename has 1 column with NULL values

From: Francisco Olarte <folarte(at)peoplecall(dot)com>
To: Narayanan Iyer <nars(at)yottadb(dot)com>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>, support(at)yottadb(dot)com
Subject: Re: GROUP BY using tablename.* does not work if tablename has 1 column with NULL values
Date: 2021-10-11 14:00:11
Message-ID: CA+bJJbz9OWmL_gKAPTUkHxv7HjDgcrO1aR0o-cjhhHRQSy6B7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Narayanan:

On Mon, 11 Oct 2021 at 14:10, Narayanan Iyer <nars(at)yottadb(dot)com> wrote:
...
> You are right. My inner query was an outer join returning 3 rows. But what I did not understand was that the NULLs in 2 of the 3 rows were different because 1 was a composite NULL and 1 was a ROW(NULL) and hence they showed up as 2 different NULLs/rows even after a GROUP BY. Tom's explanation cleared it up for me.

Perfect. null rows, row(null) and siblings are extremely tricky, I
always try to avoid them, just pointed it in case you did not run the
subquery first and counted results.

Francisco Olarte.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Emil Iggland 2021-10-11 14:07:40 Re: BUG #17141: SELECT LIMIT WITH TIES FOR UPDATE SKIP LOCKED returns wrong number of rows
Previous Message Narayanan Iyer 2021-10-11 12:10:04 RE: GROUP BY using tablename.* does not work if tablename has 1 column with NULL values