Re: BUG #17158: Distinct ROW fails with Postgres 14
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: sait.nisanci@microsoft.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Date: 2021-08-24T09:55:18Z
Lists: pgsql-bugs
On Tue, 24 Aug 2021 at 21:02, PG Bug reporting form
<noreply@postgresql.org> wrote:
> -- This works fine before pg14.
> SELECT DISTINCT ROW(col1, col2, col3, col4, col5, col6, col70, col7, col8,
> col9, col10,
> col11, col12, col13, col14, col15, col16, col17, col18, col19, col20, col21,
> col22, col23, col24, col25,
> col26, col27, col28, col29, col32, col33, col34, col35, col36, col37, col38)
> AS "row" FROM local WHERE true;
> ERROR: could not identify a hash function for type bit
It looks like 01e658fa74 is to blame for this.
The test case can be simplified down to just:
create table local (b bit);
insert into local values('1'),('0');
SELECT DISTINCT ROW(b) FROM local;
Tom did have a look at this and raise the question about the
possibility of not being able to hash in [1].
If it's going to be a problem detecting the lack of hashability during
planning then maybe we can just add a hash opclass for BIT to fix this
particular case.
I've copied in Peter as 01e658fa74 is one of his.
David
[1] https://www.postgresql.org/message-id/20201019233234.r6lyxbvdg5s77rvd%40alap3.anarazel.de
Commits
-
Fix hash_array
- 9b2fd490577b 14.0 landed
- 851ff9335742 15.0 landed
-
Disable anonymous record hash support except in special cases
- 054adca641ac 14.0 landed
- a3d2b1bbe904 15.0 landed