Re: Inconsistent cast to "char" - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Inconsistent cast to "char"
Date
Msg-id 2216960.1638480683@sss.pgh.pa.us
Whole thread Raw
In response to Re: Inconsistent cast to "char"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
I wrote:
> To be clear, the change I'm thinking of would result in errors, not in
> silently applying the int4 cast.  As a quick-n-dirty test:

> regression=# update pg_type set typcategory = 'x' where typname = 'char';
> UPDATE 1
> regression=# select 1::int8::"char", 1::int4::"char", 1::int2::"char";
> ERROR:  cannot cast type bigint to "char"
> LINE 1: select 1::int8::"char", 1::int4::"char", 1::int2::"char";
>                       ^

It turns out that changing the typcategory does have some undesirable
side-effects, but I found another possible workaround.  Patch
posted at [1].

            regards, tom lane

[1] https://www.postgresql.org/message-id/2216388.1638480141%40sss.pgh.pa.us



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Inconsistent cast to "char"
Next
From: PG Bug reporting form
Date:
Subject: BUG #17311: Google search results: Outdated docs at the top