pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Is this error expected ?
4+ messages / 3 participants
[nested] [flat]

* Is this error expected ?
@ 2022-10-19 06:50  Yavuz TANRIVERDİ <sternix@gmail.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Yavuz TANRIVERDİ @ 2022-10-19 06:50 UTC (permalink / raw)
  To: pgsql-general

Hi,

i have an

"ERROR:  UNION types "char" and text cannot be matched CASE WHEN
indisprimary THEN"

error from

https://github.com/yiisoft/yii/blob/e7c298343bf1f76186d443b62ff853d2d36e19f0/framework/db/schema/pgs...

I read release notes, but can't find any related change,

It works for PostgreSQL 14.5 but fails with PostgreSQL 15.0, a test
sample below.

Is this error expected ?

Thanks,

create table tbla
(
    a "char"
);

create table tblb
(
    b char(1)
);

insert into tbla values ('a');
insert into tbla values ('b');

insert into tblb values ('c');
insert into tblb values ('d');

-- works with 14.5 fails on 15.0

select a from tbla
union all
select
case when true then
    'p'
else
    'u'
end from tblb;

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Is this error expected ?
@ 2022-10-19 07:15  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Yavuz TANRIVERDİ <sternix@gmail.com>
  1 sibling, 1 reply; 4+ messages in thread

From: Laurenz Albe @ 2022-10-19 07:15 UTC (permalink / raw)
  To: Yavuz TANRIVERDİ <sternix@gmail.com>; pgsql-general

On Wed, 2022-10-19 at 09:50 +0300, Yavuz TANRIVERDİ wrote:
> i have an 
> "ERROR:  UNION types "char" and text cannot be matched CASE WHEN indisprimary THEN"
> error from 
> https://github.com/yiisoft/yii/blob/e7c298343bf1f76186d443b62ff853d2d36e19f0/framework/db/schema/pgs...
> I read release notes, but can't find any related change,
> It works for PostgreSQL 14.5 but fails with PostgreSQL 15.0, a test sample below.
> Is this error expected ?

Yes, it is.  See this paragraph from the release notes
(https://www.postgresql.org/docs/current/release-15.html#id-1.11.6.5.5.13):

- Create a new pg_type.typcategory value for "char" (Tom Lane)
  Some other internal-use-only types have also been assigned to this category.

Perhaps that should have been listed as a potential compatibility break, but
the documentation explicity says that "char" is not intended for use by the
end user (https://www.postgresql.org/docs/current/datatype-character.html):

> These are not intended for general-purpose use, only for use in the internal system catalogs.

You will have to add an explicit type cast.

Yours,
Laurenz Albe





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Is this error expected ?
@ 2022-10-19 07:31  Yavuz TANRIVERDİ <sternix@gmail.com>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 0 replies; 4+ messages in thread

From: Yavuz TANRIVERDİ @ 2022-10-19 07:31 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-general

Ok, thank you very much,

On Wed, Oct 19, 2022 at 10:15 AM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:

> On Wed, 2022-10-19 at 09:50 +0300, Yavuz TANRIVERDİ wrote:
> > i have an
> > "ERROR:  UNION types "char" and text cannot be matched CASE WHEN
> indisprimary THEN"
> > error from
> >
> https://github.com/yiisoft/yii/blob/e7c298343bf1f76186d443b62ff853d2d36e19f0/framework/db/schema/pgs...
> > I read release notes, but can't find any related change,
> > It works for PostgreSQL 14.5 but fails with PostgreSQL 15.0, a test
> sample below.
> > Is this error expected ?
>
> Yes, it is.  See this paragraph from the release notes
> (https://www.postgresql.org/docs/current/release-15.html#id-1.11.6.5.5.13
> ):
>
> - Create a new pg_type.typcategory value for "char" (Tom Lane)
>   Some other internal-use-only types have also been assigned to this
> category.
>
> Perhaps that should have been listed as a potential compatibility break,
> but
> the documentation explicity says that "char" is not intended for use by the
> end user (https://www.postgresql.org/docs/current/datatype-character.html
> ):
>
> > These are not intended for general-purpose use, only for use in the
> internal system catalogs.
>
> You will have to add an explicit type cast.
>
> Yours,
> Laurenz Albe
>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Is this error expected ?
@ 2022-10-19 13:57  Ron <ronljohnsonjr@gmail.com>
  parent: Yavuz TANRIVERDİ <sternix@gmail.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Ron @ 2022-10-19 13:57 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 10/19/22 01:50, Yavuz TANRIVERDİ wrote:
> |Hi,|
> |i have an |
> |
> |"ERROR: UNION types "char" and text cannot be matched CASE WHEN 
> indisprimary THEN"||
> |error from |
> |https://github.com/yiisoft/yii/blob/e7c298343bf1f76186d443b62ff853d2d36e19f0/framework/db/schema/pgs...|
> |I read release notes, but can't find any related change,|
> |It works for PostgreSQL 14.5 but fails with PostgreSQL ||15.0, ||a test sample below.|
> Is this error expected ?
> Thanks,
> |create table tbla ( a "char" ); |

Try CHAR(1) instead of just CHAR.

> |create table tblb ( b char(1) ); insert into tbla values ('a'); insert 
> into tbla values ('b'); insert into tblb values ('c'); insert into tblb 
> values ('d'); -- works with 14.5 fails on 15.0|
> |select a from tbla union all select case when true then 'p' else 'u' end 
> from tblb; |

-- 
Angular momentum makes the world go 'round.

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2022-10-19 13:57 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19 06:50 Is this error expected ? Yavuz TANRIVERDİ <sternix@gmail.com>
2022-10-19 07:15 ` Laurenz Albe <laurenz.albe@cybertec.at>
2022-10-19 07:31   ` Yavuz TANRIVERDİ <sternix@gmail.com>
2022-10-19 13:57 ` Ron <ronljohnsonjr@gmail.com>

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