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 1mgaCu-0002Du-3Y for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Oct 2021 22:18:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mgaCs-0005a0-Ql for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Oct 2021 22:18:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgaCs-0005Zq-83 for pgsql-bugs@lists.postgresql.org; Fri, 29 Oct 2021 22:18:38 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mgaCn-0007zL-Of for pgsql-bugs@lists.postgresql.org; Fri, 29 Oct 2021 22:18:37 +0000 Received: by mail-pg1-x536.google.com with SMTP id r28so11194236pga.0 for ; Fri, 29 Oct 2021 15:18:33 -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=C/xzNExSciUaLaPwKJ/p6LoTqtc1RcM8tdVwMoMHAJE=; b=UhCko4rqo/h1ZOEQ3oR0PV3iyiZQcE7aStP6AiXz7Kv/eOmdhaDwWcknEoyEswdUid CuwG3bmjA2HaaC64Cdxal5trOeMpcQtsi+zENVJcJunqQoztiVdjbPAQCP1lRGgNI6Nf EJZhh4GuylJ99ZjxBHRAfYM2AeB9p9uRs9qoyAmfV/YVy1Lv+Ncb/9UVSVPR3G5hYu2s 6bXHVIzRX1Toyr20Ln4/cYrIrx8lezc8+1MA8QSWqGQu3GwAZDL2a7drTSR2+0qbjtMV uIAx1FItiOQZv4ahkSUQuO+UEgXhT4gSM6t2cIeTEPdBh1S+XgVM/tcNIqakWbpZ5Syk 4shg== 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=C/xzNExSciUaLaPwKJ/p6LoTqtc1RcM8tdVwMoMHAJE=; b=dG+1ZBbFNegxmZHbtHM3jg+8yAGPJw+G0P3jM90YYh9vLiTcwV2yOeB9hk4qMBa6/v S7pCSeMumKBiTLLAHDVmwxOj/lJL9HZxn7Q9h+UEX5VJZ1xodNDLuB+piHvA4+6wiLeM ZXqbJdM6dUxymCoBno363X8Mm/mzK0rMdaWVZNt1hJQzgDtO56Ec1dNH+v2xQ+8RuIXE JrUrXR1dlhsDdYsIrgqRe4O5Dx6GilgMr8UIs2c1ML2cgr1DJ4MRsUGsebQVIvCjBI4k 3+pGOJh0f6gRtizL3dYQu+CAqeSYXgJook91TsLFa4hGZuaCyilNdecjN/36yDEIMyEN ygnw== X-Gm-Message-State: AOAM532TFP/VspeupXDWAlxn7EgppQKMH5U/OXftepFJnXhjMTVlXVd0 csVcJu322JpSvF16ZF/vN8oLBfdQFSocYucKSxPi5+p3xn6YrsHtHRg8TTAdrDSxJSnjR1C90NU N2wrW1PNxRNnMmucmzd4qvGA9xsoIFs5HajU7wUSn8L+qbMYbKjaEl/c8hw/uTwx1UxMCbC3+xU 70qP3rkyD9ueWGCeYShq4d7/5velPYrN+x9dTqnvqZV+Zq X-Google-Smtp-Source: ABdhPJzgHLbAWXmgBs89pC1g9PJSoZGIDlpiEjbed4XuCgx2hPkwbmlLTx9y7Kd31TI5vc2WI3XNpQ== X-Received: by 2002:a63:7d01:: with SMTP id y1mr10233679pgc.343.1635545911301; Fri, 29 Oct 2021 15:18:31 -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 z22sm7269689pfa.214.2021.10.29.15.18.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Oct 2021 15:18:30 -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: Date: Fri, 29 Oct 2021 15:18:30 -0700 Cc: "" , PostgreSQL mailing lists 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> <005901d7cd0f$500f1c10$f02d5430$@calascibetta.com> To: "David G. Johnston" 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 3:13 PM, David G. Johnston = wrote: >=20 > For practical purposes you will frequently hit the one bit or the = other. =20 >=20 >=20 > As I noted in a prior reply, octet_length(char) does the length = computation with the padding spaces. So it is possible for char input = functions to do the expected thing. Yes, I saw that. But there aren't that many functions like octet_length = that do so. If users coming from other RDBMSs expect CHAR(1) to behave = as David expects them to behave, it's cold comfort to say, "hang in = there, you can still use octet_length() on them!" Better to say that = they are going to be bitten by this expectation again and again, and = instead choose a different datatype (which you also said.) =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company