Re: Handling of pad characters (was RE: Oracle buys Innobase )

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Guy Rouillier" <guyr(at)masergy(dot)com>
Cc: "PostgreSQL General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Handling of pad characters (was RE: Oracle buys Innobase )
Date: 2005-10-21 20:29:06
Message-ID: 25320.1129926546@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Guy Rouillier" <guyr(at)masergy(dot)com> writes:
> Tom Lane wrote:
>> 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.

> How did you reach the opposite conclusion for varchar? If anything, I
> would think that stripping pad characters makes more sense for varchar
> than it does for char.

But they're not pad characters in varchar --- remember varchar is
implicitly NO PAD (vs char which is implicitly PAD SPACE).

The spec would like us to separate out the PAD attribute from the
datatypes, and eventually we may get around to doing that, but in
the meantime it's hardly likely that we'll drop functionality by
smushing the datatypes together. Seeing that there's no performance
advantage to char in Postgres, we might as well not have the separate
datatype at all if we're going to give it semantics identical to varchar.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Browne 2005-10-21 20:49:01 Re: transaction limits?
Previous Message David Fetter 2005-10-21 20:25:09 Re: looking for alternative to MySQL's GROUP_CONCAT function