Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ol9a3-0004BA-PH for pgsql-general@arkaria.postgresql.org; Wed, 19 Oct 2022 13:57:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ol9a2-0006dD-KZ for pgsql-general@arkaria.postgresql.org; Wed, 19 Oct 2022 13:57:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ol9a2-0006cy-AZ for pgsql-general@lists.postgresql.org; Wed, 19 Oct 2022 13:57:58 +0000 Received: from mail-oa1-x33.google.com ([2001:4860:4864:20::33]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ol9a0-0006SN-0S for pgsql-general@lists.postgresql.org; Wed, 19 Oct 2022 13:57:57 +0000 Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-1324e7a1284so20711246fac.10 for ; Wed, 19 Oct 2022 06:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=ykiQCFq6ihr30ClJQiqvB3T+Yr2RXaKHSLlUmJySypE=; b=FOF7w4LgYLPInhHZpwr1JEkMUZmZCiNbCgmMJy21nPUJMLVUO5h8WjHa96KuCd53uT owQCOBstaNHIFchZvyDA0kcEdi9khiDog311K3QO0JFIiish1CZAs5iSkGRhDMk5Fjmm /qJnPvc3fNLkwYKDQWWa2leVMQS7pMzeGpmXD0maifsw4f9lYnmnxTh1WpzilQ84+fpU tDIGtCXCMcH1Vr16S7ZE6eM+VEC+Q+yFrsXfiTF7adp8zDACXhQzIjEKjBvvNHaRrWfi Vxhx8+TgcofvpD/z9ZXDQJtLRuiy0Fb21VgcFSRkgClBg63tyK0gGNB4K/Ic+H5vIklG qeeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=ykiQCFq6ihr30ClJQiqvB3T+Yr2RXaKHSLlUmJySypE=; b=ygl/jYhVjz/zmCTpB8bDj4dZtr5YqIeJ3ozqTaKLiSi721VpKV/qIy69NkbXeiq2G+ 2KxNnCVcWoKlZOYhreUxgBWPAjDAy+4oHaJiMhf1rnf2iOMNNKhBTT3rpjTiT1Rcpqfr 9TG5r/ZFqp0+JxrOycJkl43cUQrofdlxjCk+5Juo+tw7kk2peClKeERTknYyF5xwO8i5 +HdgLFtGnp3OH1EVWAW69qclcgV4WR4ILW/NJdqcn6VOx5k54OLPpiiB2miG5/DmvgJm WCKupIkUYJCTVGEnZWFuxCVLg9Hq6D6htDDKaMKxAi865IlEPq1PI0s8aQ40JPjowZc7 ThDA== X-Gm-Message-State: ACrzQf15BYWpsHWX8WL0bNupjBXfdZv0aRRRtU+SSe8X4cp1qSuixyQ1 6w67AT+4/m2Qt4S55wPGTvS5qf1G+bU= X-Google-Smtp-Source: AMsMyM5DIqBeHt1ezPwK9Iu7IR+zayXPQ3RYW+b4P2vN4eHiY8NJ0b7RLCnaNnDs+FU/stBdAnL4mQ== X-Received: by 2002:a05:6870:f14a:b0:136:6a3f:1ef3 with SMTP id l10-20020a056870f14a00b001366a3f1ef3mr21186313oac.144.1666187874881; Wed, 19 Oct 2022 06:57:54 -0700 (PDT) Received: from [192.168.88.10] (ip68-11-68-85.no.no.cox.net. [68.11.68.85]) by smtp.googlemail.com with ESMTPSA id x7-20020a9d6287000000b00661a1a48079sm6984853otk.7.2022.10.19.06.57.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 06:57:53 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------A0zOoOqZ5KE0cAuEhqd2Vsvl" Message-ID: Date: Wed, 19 Oct 2022 08:57:53 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: Is this error expected ? Content-Language: en-US To: pgsql-general@lists.postgresql.org References: From: Ron In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------A0zOoOqZ5KE0cAuEhqd2Vsvl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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/pgsql/CPgsqlSchema.php#L233| > |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. --------------A0zOoOqZ5KE0cAuEhqd2Vsvl Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit 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/pgsql/CPgsqlSchema.php#L233
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.
--------------A0zOoOqZ5KE0cAuEhqd2Vsvl--