BUG #17101: Inconsistent behaviour when querying with anonymous composite types - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #17101: Inconsistent behaviour when querying with anonymous composite types
Date
Msg-id 17101-a6faa1f74b35062d@postgresql.org
Whole thread Raw
Responses Re: BUG #17101: Inconsistent behaviour when querying with anonymous composite types  (Andrew Kiellor <akiellor@gmail.com>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      17101
Logged by:          Andrew Kiellor
Email address:      akiellor@gmail.com
PostgreSQL version: 13.3
Operating system:   Debian (docker)
Description:

I've observed some inconsistent behaviour when querying with anonymous
composite types. The following queries illustrate the observations:

-- cleanup
DROP TABLE IF EXISTS table1;
DROP TYPE IF EXISTS type1;

-- scenario
CREATE TYPE type1 AS (x int);

CREATE TABLE table1 (column1 type1);

INSERT INTO table1 (column1) VALUES ('(0)');

-- passing scenario - equality with typed composite type
SELECT * FROM table1 WHERE column1 = '(0)'::type1;

-- failing scenario - equality with anonymous composite type
SELECT * FROM table1 WHERE column1 = '(0)';

-- passing scenario - IN query with multiple anonymous composite types
SELECT * FROM table1 WHERE column1 IN ('(0)', '(0)');

-- failing scenario - IN query with single anonymous composite type
SELECT * FROM table1 WHERE column1 IN ('(0)');


pgsql-bugs by date:

Previous
From: Sergei Kornilov
Date:
Subject: Re: BUG #17099: Problem with EXECUTE and JSON
Next
From: Andrew Kiellor
Date:
Subject: Re: BUG #17101: Inconsistent behaviour when querying with anonymous composite types