domain type with create cast not working on pg15, but work on pg14 - Mailing list pgsql-bugs

From alias
Subject domain type with create cast not working on pg15, but work on pg14
Date
Msg-id CAJA4AWTdyc15kVwHpEFG7u9FMVuExEQdAi9Mf9tCK778sKwToQ@mail.gmail.com
Whole thread Raw
Responses Re: domain type with create cast not working on pg15, but work on pg14
List pgsql-bugs
seems like a bug, since PostgreSQL 15 - pgPedia - a PostgreSQL Encyclopedia does not mention anything about domain/cast changes. 

the following code works on
 PostgreSQL 15devel (Ubuntu 15~~devel~20220407.0430-1~713.git79b716c.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit
 ---
create domain isodow as integer check(value between 1 and 7);
create function testcast(in a timestamptz ,out isodow)
as $$ select extract(dow from  a ) $$ language  sql;
CREATE CAST (timestamptz AS isodow) WITH FUNCTION testcast(timestamptz) AS ASSIGNMENT;
----
then execute it:
   select '2022-04-23 19:00:01 +5:30'::timestamptz::isodow; 
return 6
---
however when i run it  PostgreSQL 14.2 (Ubuntu 14.2-1.pgdg20.04+1+b1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit

yield the following error:
ERROR:  42846: cannot cast type timestamp with time zone to isodow
LINE 1: select '2022-04-23 19:00:01 +5:30'::timestamptz::isodow;
                                                       ^
LOCATION:  transformTypeCast, parse_expr.c:2652

 

pgsql-bugs by date:

Previous
From: Noah Misch
Date:
Subject: Re: BUG #17401: REINDEX TABLE CONCURRENTLY creates a race condition on a streaming replica
Next
From: 와따가따
Date:
Subject: [issue] wal_buffers_full increases depending on the values of wal_buffers and wal-segsize