From: vodevsh@gmail.com
To: pgsql-docs@postgresql.org
Subject: tip to workaround trailing spaces removal on char to varchar conversion
Date: Wed, 20 Sep 2017 12:46:26 +0000
Message-ID: <20170920124626.17363.48015@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-docs>
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/9.6/static/datatype-character.html
Description:
removing trailing spaces on (implicit) cast from char to text can be
painful, and always surprising as shown in example with
SELECT 'a '::CHAR(2) collate "C" < E'a\n'::CHAR(2)
would it be worth mentioning a tip, that this behaviour can be monkey hacked
by concat(str "any" function that accepts char and returns text, thus
respecting the spaces, eg SELECT concat('a '::CHAR(2) collate "C") <
E'a\n'::CHAR(2) will return false as expected...
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
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-docs@postgresql.org
Cc: vodevsh@gmail.com
Subject: Re: tip to workaround trailing spaces removal on char to varchar conversion
In-Reply-To: <20170920124626.17363.48015@wrigleys.postgresql.org>
* 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