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 1v9UnX-001RdU-FX for pgsql-docs@arkaria.postgresql.org; Thu, 16 Oct 2025 20:42:06 +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 1v9UnW-00FUCt-Du for pgsql-docs@arkaria.postgresql.org; Thu, 16 Oct 2025 20:42:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v9UnW-00FUCl-6c for pgsql-docs@lists.postgresql.org; Thu, 16 Oct 2025 20:42:05 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v9UnT-002A1o-20 for pgsql-docs@lists.postgresql.org; Thu, 16 Oct 2025 20:42:04 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-290b48e09a7so11789915ad.0 for ; Thu, 16 Oct 2025 13:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760647322; x=1761252122; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hLnVuPkUIaWKzL1LrFyUfK1w5j6rc9WbJzMADd63rY8=; b=Jr2j1NrpeKTjE1FtUnGdA4Gt80OlZhck4349knwO4G5tq/YdXsJev8lqOkD1lVzow9 vT4Y8sXlZQqtRR/C/SOP1C1pJxOVy1NuieESfJ7MnNyhGYluRYosB5wK2GSR8o811aQT UbHThDePWfXMd7F3xUbi7WWQZkoLVP/AsYqCSBUHxILeDmHUf9np9HCn0v/rH6LExOK3 bh2TnDvYnkeCAcRMWBcuLbBCmfbSHXdVM8ZKozUhTwle1wdqRcw3meo6DFrABbMKBc/r oChLeom9A8sjvVjzha0dMm7f0qseYe/qklaULVo/jwFY9/zhYWgVYw8fCnqOreEkDiJc bIRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760647322; x=1761252122; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hLnVuPkUIaWKzL1LrFyUfK1w5j6rc9WbJzMADd63rY8=; b=ppEoFDp4YK0X5b77XYtlGUW9KuDWYV9+DfI9yvFRXo4JlGRR7k+iiukaXS+R5x/6Xm cZhA//k1KtxURmAPoKGvjAz1uSBwVzo/tC1MV3+EooHJDDCSVCESjxvO7WBlfW4E0YSw aeHzm7O5rnRpEYz5FR6M/hWI+jo06KA6Xe7UMGjABzMP10FTHVJ5BjvAqjDTPPpDlhgX zYLRRjrkzA2CYmcVhUkG+QSuzrKWgohInEQypLI1Sj0IC4xzrvVB3KitZ6FMhUmiXF2x ZnAcidHOZnEEpUT3+t3TaeKGjrTNVjAsaoBdLFSETNcxw2Sq1/pJhXQkFTPdyTYAjV0V nrwA== X-Forwarded-Encrypted: i=1; AJvYcCWp385gKcCFowrA3HPn3+c4oFzuzIvg9i/GVEqI9F4nXZNIkGuxH9J5rBLoNG7HqmJF22xHEknjhYxH@lists.postgresql.org X-Gm-Message-State: AOJu0Yyr6ANJRY0nLqwZv/LoqRwX+Yd9OkHBqu7Pjj3RWuBlv2TOTYvt OWwYtAaipj42DL24XpsLrZHA+/H/5/Bpo8n17S1eobyGKkkgVVWHYJm9ZDYZwyBBZ5ydmwdCGS7 vYe/T9ml+H0qLhfl0L3SwWEs+2Wq7rig= X-Gm-Gg: ASbGncvbBlZh+kBRN1lhNaqGmPVkAIBsyGJyKNe312avnpmddZocQXZRnBo92VMQ88t SJd+4R716C5hW84sBG7V+/MwwMxSDjhJYDv0nvsMkwlblMjVgU/DzAM5yKHg1/M2/pxXWWifEmI TthcYfljtY6Igi2rDTTAQNyatXicdDsI0wkOG12FsoQSI9vAGi2g/wwKTLJ41R/fFKvOGlXyC3T 4c2iGt8oG944kA7nY8Vj3GdKU5AuH3umOTuaCswBSQ+MSMDIC2qj3ReIXvTTg== X-Google-Smtp-Source: AGHT+IF9wk3NrlpRkbZ4Q0TxnD5W9RtYpYNmD47jP1t+5QKoC5ui/BqYdchd4sH63MS9vN4kgjYjY7hJKZiZFEuA0AY= X-Received: by 2002:a17:902:e88e:b0:290:a3b9:d4be with SMTP id d9443c01a7336-290c9ce63cbmr12711005ad.24.1760647322378; Thu, 16 Oct 2025 13:42:02 -0700 (PDT) MIME-Version: 1.0 References: <176044409338.770.16064383081308443747@wrigleys.postgresql.org> <1307875.1760556576@sss.pgh.pa.us> In-Reply-To: From: Sergei Katkovsky Date: Fri, 17 Oct 2025 00:41:37 +0400 X-Gm-Features: AS18NWBQI3v4ixHTQ70Q56MBCDVmHX7oC9d5j_O8MsbAV0xRSl8_dqYMPHNrL9A Message-ID: Subject: Re: BPCHAR description in 8.3. Character Types is misleading and incomplete To: "David G. Johnston" Cc: Tom Lane , Jeff Davis , "pgsql-docs@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Oct 16, 2025 at 11:18=E2=80=AFPM David G. Johnston wrote: >> > Think of padding as a noun, not a verb. =E2=80=9CThe value contains p= adding=E2=80=9D. Not, =E2=80=9C I am padding the value=E2=80=9D. > > In PostgreSQL the behavior and stored contents/representation of a value = are not influenced by a type modifier. It is only used during input to per= form some either or both a validation or transformation. Here, when presen= t, it performs a padding transform. But present or absent, trailing spaces= , if any, are considered padding. The prose for the section talk about the= two key pieces: (n) imposes a length limit while also transforming an inpu= t by adding padding spaces. The non-n case has unlimited length and no tra= nsformation. Post-construction, all trailing spaces are treated as padding= . Am I right that your reasoning, when expanded, turns into "BPCHAR is blank-padded, where '-padded' means (Definition 1) that its values may have trailing blanks, which, if present, are considered 'padding' (Definition 2), which, in its turn, means a sequence of blanks insignificant in some contexts (Definition 3)"? Yes, technically it is correct, provided that others accept all those definitions. But don't you think that in the documentation we should, whenever possible, use words in their most commonly understood meanings? I'm not a language expert, but I have never seen 'padded' in the sense different from 'something added to gain some needed size/shape/etc'. This is anecdotal evidence, of course, so I can be wrong, but could you come up with a counterexample? Even in the PostgreSQL docs for BPCHAR(n) 'padded' means 'with spaces added up to n' ('values of type character will be space-padded', 'Values of type character are physically padded with spaces' - as a verb, not a noun, btw). I'm afraid that adding another meaning to the word 'padded' in the same text will cause even more confusion. With best regards, Sergei Katkovskii