Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v9jtY-007ANH-N0 for pgsql-docs@arkaria.postgresql.org; Fri, 17 Oct 2025 12:49:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v9jtX-002X34-F4 for pgsql-docs@arkaria.postgresql.org; Fri, 17 Oct 2025 12:49:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v9jtX-002X2w-6H for pgsql-docs@lists.postgresql.org; Fri, 17 Oct 2025 12:49:18 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v9jtU-002ifb-0w for pgsql-docs@lists.postgresql.org; Fri, 17 Oct 2025 12:49:17 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4711f3c386eso3495645e9.0 for ; Fri, 17 Oct 2025 05:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1760705353; x=1761310153; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=PnhqHzLUKlKRj7diVYEe21iCAxcr4Bolkn+EGbqvuSE=; b=o5q7IjYnLgAQOqNHbpuy+qWbxrEreTwQpTdsM5VCCaZCLr++SaCCzbwa80HzooT6hC 2BoJsNHKnrDlRuhss9BTgkKMUnHo5SocI0XOJjAln2FAjuu0Y7glUbS+ZcmTu5iNbFFS 9Pr7qLgUyTqELrK7JFq2Hw6NMx1HjF4WwDpI19i/lhqVqAO3ZBdhoRc46ReB85n9PzPi B+XpcO+gRNUMGpwHf+pd8K+QGRNO9lW6mDiFzF2ImRVRPvREcTfapzMhzDasAR16C+OV evAXsXFJHCUFzi06e43/ATewQJALE9jbNW1Uilc3qgqCgfa8tRhZGLsKOABCqC4t+Mij aqvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760705353; x=1761310153; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=PnhqHzLUKlKRj7diVYEe21iCAxcr4Bolkn+EGbqvuSE=; b=kixAT17T1L7+20X4EhC1Ogy1nVm9kNC8aYBKdD6w1mb6upSirPg1kKBRvZ0jYcU5Vk 3Mn0tSk4//tE9ckZYL+8pr4uz13Y574AmPtyGUzAp4BY56PKDzBYfWjIAD8xtx0M2Mk9 MVGBZ9MgrBUn+h8J5hJjXicFpD//c4m9ZbPxE1xiDTQYvPX7iCitlA3DSVKX0C4HGCVx aUL6ZS9kFIPbzI/MXgxU2OQUCfm+xkExPjvpQHDAZkrZdUHwtqwmPmVoFr4dE0SowbFK sDlkam4F17w3h11LWvRAKeohjgiSVwvNUe5Vz0CQVApSunwSvYlWpBUoO90uERhLnD7G kduw== X-Forwarded-Encrypted: i=1; AJvYcCXqP2mDvLj36KCSTJFFawqpNFfc+viwLLeHgL37UQ42oD4PmSW3itelsIvV+egcvNTPKRoX6NfSMm3N@lists.postgresql.org X-Gm-Message-State: AOJu0YyvQJnojcy2FtT8dCoMrTIDCZFMtvSnKXz9AXN1ZSpODlK/0hhu 6A/QP6aUJQCCWLAvg3lPuSAPJlkEZxnMQFItu0yNezEUfVCxS1j5h7e8P9iGOUigy+0= X-Gm-Gg: ASbGncuIkCwV0Na++OASX0sP9RQBaxjKr7LrYSfDUIX/snUkOj+NRUDEB2YM8t6q45D R461bFWQnhQFyUkDJ4V1bl67jC5EmgSaV7JZj1H5GByay0GDZX63x1OUfDftxevzpTyRgQ6K7Vb w7AqQLa/KFAE/pCqffJ7tX0012cYpQ/EMfbMw5E0FrQQwxqpNRFiUB8GlOiDcelxJiiGRg9BXxY x80fEIqLkhVAXlRzJzMJSpoHFvX16zlKncRaW3/D9ylx54LEf7uflgqdQpalTG1hacgVZv34n9r JQxF7O9j9hwx4q5sjkSmeCOxjV+FywSDUQWYHTiF/B9iH4Axk3f6qQjSVVILsvEg/1e3r6Bh2EN Xn/yOhaQotupcVA7wlqjSuuqWjz2eKhv4jps0Rb6m+yUF5mpr61qc2Tb+u/E8Bzgao1HTTUeNsW vuxiGswEXm9ilidS02D9nKRJTElvEyT+RSsfkNBZwA X-Google-Smtp-Source: AGHT+IHrMYmEYQUd8XcXg4/2lCGDbnjy7CBefNgKrqOQaQZY2C9oZExp03+Nvw8xZTLQwX1yurGhaQ== X-Received: by 2002:a05:600c:8b0c:b0:471:15df:9fcd with SMTP id 5b1f17b1804b1-47117911c51mr26521195e9.25.1760705353309; Fri, 17 Oct 2025 05:49:13 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:70:67ae:d15b:e7de:415c:f77f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47114428dedsm80851295e9.7.2025.10.17.05.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 05:49:12 -0700 (PDT) Message-ID: <92151c4debb48bbbaed4db81c79d73c36f619858.camel@cybertec.at> Subject: Re: BPCHAR description in 8.3. Character Types is misleading and incomplete From: Laurenz Albe To: Tom Lane , Jeff Davis Cc: skatkovsky@gmail.com, pgsql-docs@lists.postgresql.org Date: Fri, 17 Oct 2025 14:49:12 +0200 In-Reply-To: <1307875.1760556576@sss.pgh.pa.us> References: <176044409338.770.16064383081308443747@wrigleys.postgresql.org> <1307875.1760556576@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2025-10-15 at 15:29 -0400, Tom Lane wrote: > Jeff Davis writes: > > Please take a look at the attached patch. If you'd like your name > > included in the commit, please send it as you'd like it to appear. >=20 > I don't understand why any of these variants are better than the > original wording "blank-padded".=C2=A0 That has the non-negligible > advantage of corresponding to the type name, and furthermore > appears in many other places in our docs and source code. >=20 > There may be some other wording improvements we could make here, > but I think b69db5173 was fundamentally misguided in this respect. My suggestion is to just remove the "blank-trimmed" from the documentation. "bpchar" and "varchar", when used without type modifier, are actually identical: SELECT octet_length(BPCHAR 'x '), octet_length(VARCHAR 'x '), octet_length(TEXT 'x '); octet_length =E2=94=82 octet_length =E2=94=82 octet_length=20 =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=AA=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=AA=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90 4 =E2=94=82 4 =E2=94=82 4 The blank-trimming only occurs when a "bpchar" is converted to "text", for example when used with the concatenation operator. I suggest the following simplification: diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index b81d89e2608..05edab3bd33 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1177,11 +1177,7 @@ SELECT '52093.89'::money::numeric::float8; fixed-length, blank-padded - bpchar - variable unlimited length, blank-trimmed - - - text + text, varchar, bpchar variable unlimited length Yours, Laurenz Albe