pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: akiellor@gmail.com
Subject: BUG #17101: Inconsistent behaviour when querying with anonymous composite types
Date: Mon, 12 Jul 2021 08:37:31 +0000
Message-ID: <17101-a6faa1f74b35062d@postgresql.org> (raw)

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)');



view thread (5+ messages)  latest in thread

Message-ID: <17101-a6faa1f74b35062d@postgresql.org>
Permalink:  ../17101-a6faa1f74b35062d@postgresql.org/
Also on:    postgresql.org/message-id/17101-a6faa1f74b35062d@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, akiellor@gmail.com
  Subject: Re: BUG #17101: Inconsistent behaviour when querying with anonymous composite types
  In-Reply-To: <17101-a6faa1f74b35062d@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox