pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: PostgreSQL-documentation <pgsql-docs@postgresql.org>
Subject: Document that char() ignores spaces only in non-pattern comparisons
Date: Tue, 8 Mar 2011 11:41:43 -0500 (EST)
Message-ID: <201103081641.p28GfhB00195@momjian.us> (raw)

A private email I received indicated that our documentation about
ignoring trailing spaces in CHAR() comparisons was slightly inaccurate. 
I have update our docs to indicate it is only non-pattern comparisons
that ignore spaces with CHAR().  Applied doc patch attached.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

Attachments:

/rtmp/bpchar.diff (text/x-diff, 1.5K) download diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index b8f6e23..22d4c4e 100644 *** a/doc/src/sgml/datatype.sgml --- b/doc/src/sgml/datatype.sgml *************** SELECT '52093.89'::money::numeric::float *** 1014,1024 **** with spaces to the specified width <replaceable>n</>, and are stored and displayed that way. However, the padding spaces are treated as semantically insignificant. Trailing spaces are ! disregarded when comparing two values of type <type>character</type>, and they will be removed when converting a <type>character</type> value to one of the other string types. Note that trailing spaces <emphasis>are</> semantically significant in ! <type>character varying</type> and <type>text</type> values. </para> <para> --- 1014,1026 ---- with spaces to the specified width <replaceable>n</>, and are stored and displayed that way. However, the padding spaces are treated as semantically insignificant. Trailing spaces are ! disregarded when non-pattern comparing two values of type <type>character</type>, and they will be removed when converting a <type>character</type> value to one of the other string types. Note that trailing spaces <emphasis>are</> semantically significant in ! <type>character varying</type> and <type>text</type> values, and ! when using pattern matching comparisons, e.g. <literal>LIKE</>, ! regular expressions. </para> <para>

view thread (6+ messages)  latest in thread

Message-ID: <201103081641.p28GfhB00195@momjian.us>
Permalink:  ../201103081641.p28GfhB00195@momjian.us/
Also on:    postgresql.org/message-id/201103081641.p28GfhB00195@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-docs@postgresql.org
  Cc: bruce@momjian.us
  Subject: Re: Document that char() ignores spaces only in non-pattern comparisons
  In-Reply-To: <201103081641.p28GfhB00195@momjian.us>
  References: <201103081641.p28GfhB00195@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