pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Doc: document bpchar, clarify relationship of text and varchar.
Date: Tue, 24 Oct 2023 18:35:27 -0400
Message-ID: <ZThGrx8Gh1cvUuDs@momjian.us> (raw)
In-Reply-To: <bde2067c71ba19c2d57e02fa13ae450eea322db3.camel@j-davis.com>
References: <E1odZyZ-0000g2-AE@gemulon.postgresql.org>
	<32a9b8357e8e29b04f395f92c53b64e015a4caf1.camel@j-davis.com>
	<2129300.1670012806@sss.pgh.pa.us>
	<bde2067c71ba19c2d57e02fa13ae450eea322db3.camel@j-davis.com>

On Fri, Dec  2, 2022 at 01:55:41PM -0800, Jeff Davis wrote:
> On Fri, 2022-12-02 at 15:26 -0500, Tom Lane wrote:
> > Perhaps; you got specific wording in mind?
> 
> Here's what I came up with. It's kind of its own thing, because it
> can't be described as blank-padded.

I liked this patch and adjusted it;  patch attached.  I would like to
apply it to all branches since it provides useful information.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.

Attachments:

bpchar.diff (text/x-diff, 2.3K) download diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 5d23765705..dcb44716f5 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1174,7 +1174,11 @@ SELECT '52093.89'::money::numeric::float8; </row> <row> <entry><type>character(<replaceable>n</replaceable>)</type>, <type>char(<replaceable>n</replaceable>)</type>, <type>bpchar(<replaceable>n</replaceable>)</type></entry> - <entry>fixed-length, blank padded</entry> + <entry>fixed-length, blank-padded</entry> + </row> + <row> + <entry><type>bpchar</type></entry> + <entry>variable unlimited length, blank-trimmed</entry> </row> <row> <entry><type>text</type></entry> @@ -1230,19 +1234,22 @@ SELECT '52093.89'::money::numeric::float8; <para> The type name <type>varchar</type> is an alias for <type>character - varying</type>, while <type>char</type> and <type>bpchar</type> are - aliases for <type>character</type>. - The <type>varchar</type> and <type>char</type> aliases are defined in - the <acronym>SQL</acronym> standard, but <type>bpchar</type> is - a <productname>PostgreSQL</productname> extension. + varying</type>, while <type>bpchar</type> (with length specifier) and + <type>char</type> are aliases for <type>character</type>. The + <type>varchar</type> and <type>char</type> aliases are defined in the + <acronym>SQL</acronym> standard; <type>bpchar</type> is a + <productname>PostgreSQL</productname> extension. </para> <para> If specified, the length <replaceable>n</replaceable> must be greater - than zero and cannot exceed 10485760. - <type>character</type> without length specifier is equivalent to - <type>character(1)</type>. If <type>character varying</type> is used - without length specifier, the type accepts strings of any size. + than zero and cannot exceed 10485760. If <type>character + varying</type> (or <type>varchar</type>) is used without + length specifier, the type accepts strings of any length. If + <type>bpchar</type> lacks a length specifier, it also accepts strings + of any length, but trailing spaces are semantically insignificant. + If <type>character</type> (or <type>char</type>) lacks a specifier, + it is equivalent to <type>character(1)</type>. </para> <para>

view thread (7+ messages)  latest in thread

Message-ID: <ZThGrx8Gh1cvUuDs@momjian.us>
Permalink:  ../ZThGrx8Gh1cvUuDs@momjian.us/
Also on:    postgresql.org/message-id/ZThGrx8Gh1cvUuDs@momjian.us

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: bruce@momjian.us, pgsql@j-davis.com, tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Doc: document bpchar, clarify relationship of text and varchar.
  In-Reply-To: <ZThGrx8Gh1cvUuDs@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox