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: dan.kubb@gmail.com
Subject: BUG #17515: Change in behaviour of a composite type within a domain
Date: Thu, 09 Jun 2022 20:42:22 +0000
Message-ID: <17515-a24737438363aca0@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17515
Logged by:          Dan Kubb
Email address:      dan.kubb@gmail.com
PostgreSQL version: 14.3
Operating system:   All
Description:        

I noticed a regression in 13.7 and 14.3 in the behaviour of composite types
within a domain. Here is a simplified reproduction:

BEGIN;

-- Create composite type
CREATE TYPE my_composite_type AS (
  col1 boolean,
  col2 boolean
);

-- Create domain wrapping the composite type
CREATE DOMAIN my_domain AS my_composite_type NOT NULL;

-- Create function to test composite type
CREATE FUNCTION test_my_composite_type()
RETURNS my_composite_type
LANGUAGE sql
AS $$
  SELECT (true, true)
$$;

-- Create function to test domain
CREATE FUNCTION test_my_domain()
RETURNS my_domain
LANGUAGE sql
AS $$
  SELECT (true, true)
$$;

-- Works on 13.6/14.2 and 13.7/14.3
SELECT test_my_composite_type FROM test_my_composite_type();

-- Works on 13.6/14.2, but pg 13.7/14.3 this returns the error:
-- ERROR:  type my_domain is not composite
SELECT test_my_domain FROM test_my_domain();

ROLLBACK;

-- 

Dan Kubb



view thread (2+ messages)  latest in thread

Message-ID: <17515-a24737438363aca0@postgresql.org>
Permalink:  ../17515-a24737438363aca0@postgresql.org/
Also on:    postgresql.org/message-id/17515-a24737438363aca0@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, dan.kubb@gmail.com
  Subject: Re: BUG #17515: Change in behaviour of a composite type within a domain
  In-Reply-To: <17515-a24737438363aca0@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