pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alex Turner <armtuk@gmail.com>
Cc: Marc G. Fournier <scrappy@postgresql.org>
Cc: Doug Quale <quale1@charter.net>
Cc: pgsql-general@postgresql.org
Subject: Re: [pgsql-advocacy] Oracle buys Innobase
Date: Fri, 21 Oct 2005 12:47:21 -0400
Message-ID: <23805.1129913241@sss.pgh.pa.us> (raw)
In-Reply-To: <33c6269f0510210716x474dae2ah3861d32d8db01602@mail.gmail.com>
References: <CC1CF380F4D70844B01D45982E671B239E8BEC@mtxexch01.add0.masergy.com>
	<878xwokk4d.fsf@charter.net>
	<20051020214518.Q1006@ganymede.hub.org>
	<33c6269f0510210716x474dae2ah3861d32d8db01602@mail.gmail.com>

Alex Turner <armtuk@gmail.com> writes:
> It appears that casting to a char() causes spaces to be stripped (ignored)
> from the string:
mls=# select length('123 '::char(8));
length
--------
3
(1 row)

> I'm not sure about anyone else, but I would personaly consider that a bug?

No, it's a feature, as per extensive discussion some time ago when we
made it do that.  The general rule is that trailing spaces in a char(n)
are semantically insignificant.

			regards, tom lane



view thread (5+ messages)

Message-ID: <23805.1129913241@sss.pgh.pa.us>
Permalink:  ../23805.1129913241@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23805.1129913241@sss.pgh.pa.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-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, armtuk@gmail.com, scrappy@postgresql.org, quale1@charter.net, pgsql-general@postgresql.org
  Subject: Re: [pgsql-advocacy] Oracle buys Innobase
  In-Reply-To: <23805.1129913241@sss.pgh.pa.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