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 1mgZXr-0000Na-RD for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Oct 2021 21:36:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mgZXq-0005T3-JQ for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Oct 2021 21:36:14 +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 1mgZXp-0005QZ-Uq for pgsql-bugs@lists.postgresql.org; Fri, 29 Oct 2021 21:36:14 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mgZXm-0007KK-S3 for pgsql-bugs@lists.postgresql.org; Fri, 29 Oct 2021 21:36:12 +0000 Received: by mail-pl1-x62a.google.com with SMTP id l13so2608223pls.3 for ; Fri, 29 Oct 2021 14:36:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FhUazCQFSerwZqYxLnIDzftZU3bOwlvM4P5bUIR01FA=; b=MM6W+pBWpiwDdpnmtr//FC0+VHdND8fRFlBv7dYenPJGr8lgp0iVvrtNTAKcuFVl3P 71PGbQHIAgzfOc/xohkJcmXO7lYFKgBtf2OZc4cRB4bqhccZxqfJYOOeBdtxr9lwcBvd fQ4SASCtZwik+1z5Nbs9qSAB7IRkEAx/61Qc/yskeFpAKmiZMp6Q7kifpr3xznck44HA IjR8NhGUIQBdOjMp+7bLsk2SyW0Vzx2uIE3PN7vs58ZGWk0u+VSAsAF32blnSYAfGGQa T12gSQODktmLo/3wes6gqR612V0u55qcjskyrrkgDQOsliKN01xahzti6dAE/PpDcfKY 3P5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FhUazCQFSerwZqYxLnIDzftZU3bOwlvM4P5bUIR01FA=; b=PLFCBUQUp3kz6fiA/26B5Z4zEinYfxnHgjZ576A3HdAAkto0KoCm5p6ZtMq1zB31p0 6b9m1X9AadUb1h6uvrvI6D04G4ZEc1fmDAeeUWPU5Rw4QVoupcAwYmf5KboQKpdepqJC JeOwn52ZPHj5n6br0LkXutSu5DgP5OhczFUv+8Y85WxDHot6xq7n66ym1k0sF9anJZI/ cJTFUNWBZ8P0Orb3Eu9otbymCKzEhignWTLjrpuaw+n8TmD1K+zhuKX4mNbW+xxeuUSP 4zesjOt/dprmXgj54MVN3XXcdXe0ytgvXjEP3c0SoUCeRiD/in+Y+ImHXxyeUUhu4pp5 N+fw== X-Gm-Message-State: AOAM5323VE0JFvV4bPv1twgGl6FeaicjFs65rQPxpL2nEXHG7WggCnq4 OVeMxb15swM7RJJsVBJsQTJuDsR+qmcdfhhTGMDVA/y/MCeypbEGaR9saEivl7c9+VlyP8vrjJY 5e0Iz5rFRaHa0thyfpbb2Y6FSGuDVQzEtZqO5NiFm6wS7bCPIFobm6ELUaLca0VHeq96SdhY8EC cLannGsnmSCyhFz+w2yJo2Fco4gzwLpjEIXsBRoVziRqjx X-Google-Smtp-Source: ABdhPJylLRSRqP5W4/Tbta0t4osPPLnKVL0Gf1fPVofa9WIObNAH28MdceypyMnL3zulMKIFMTPQ5A== X-Received: by 2002:a17:90a:8c0f:: with SMTP id a15mr4614pjo.25.1635543369603; Fri, 29 Oct 2021 14:36:09 -0700 (PDT) Received: from laptop280-ma-us.hitronhub.home (24-113-193-150.wavecable.com. [24.113.193.150]) by smtp.gmail.com with ESMTPSA id v16sm7176916pfu.208.2021.10.29.14.36.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Oct 2021 14:36:09 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: BUG #17258: Unexpected results in CHAR(1) data type From: Mark Dilger In-Reply-To: <005501d7cd0b$9ba5d5f0$d2f181d0$@calascibetta.com> Date: Fri, 29 Oct 2021 14:36:08 -0700 Cc: pgsql-bugs@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <17258-a7c164c5fb955221@postgresql.org> <19D58355-E7C3-47D7-9C87-51EC751AE2BB@enterprisedb.com> <003701d7ccfb$c2a85bb0$47f91310$@calascibetta.com> <0EE9669C-6E65-40E1-B492-F989F452DAC4@enterprisedb.com> <005501d7cd0b$9ba5d5f0$d2f181d0$@calascibetta.com> To: "" X-Mailer: Apple Mail (2.3608.120.23.2.7) X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Oct 29, 2021, at 2:26 PM, David M. Calascibetta = wrote: >=20 > OK. I have a work-around so I'm alright. Glad to hear it. > I agree, the behavior is nuts, and is inconsistent with every other = RDBMS out there. I haven't studied the behavior of char(n) on other RDBMS products. I'd = be curious if the SQL spec says anything that we're violating in this = regard. If so, we should at least have a warning in the docs about = that. (We already have a warning about how char(n) behaves, but nothing = I see about the behavior being non-compliant.) But I'm wondering if = other RDBMS products really differ in this regard? Are you perhaps = thinking about how varchar(n) works?=20 > I was only reporting it to improve the product, but if you think this = is appropriate behavior, > I'm good with it. I tend to think of char(n) as a misfeature and avoid using it. Based on = your experience with other RDBMSs, would you expect char(n) and = varchar(n) to behave the same or to behave differently? In postgres, = they are different, and varchar(n) would behave more like you seem to = want. =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company