Re: Blank-padding (was: Oracle buys Innobase)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Dean Gibson (DB Administrator)" <postgresql4(at)ultimeth(dot)com>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Blank-padding (was: Oracle buys Innobase)
Date: 2005-10-22 03:23:48
Message-ID: 27840.1129951428@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

"Dean Gibson (DB Administrator)" <postgresql4(at)ultimeth(dot)com> writes:
> I remember that discussion, and I was for the change. However, upon
> doing some testing after reading the above, I wonder if the
> blank-stripping isn't too aggressive. I have a CHAR(6) field (say,
> named Z) that has "abc " in it. Suppose I want to append "x" to Z,
> with any leading spaces in Z PRESERVED.

(You meant trailing spaces, I assume.) Why exactly would you want to do
that? You decided by your choice of datatype that the trailing spaces
weren't significant. This gripe seems to me exactly comparable to
complaining if a numeric datatype doesn't remember how many trailing
zeroes you typed after the decimal point. Those zeroes aren't
semantically significant, so you have no case.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Travers 2005-10-22 05:39:13 Re: Blank-padding
Previous Message Tom Lane 2005-10-22 03:17:25 Re: Quickly calculating row size of a table?

Browse pgsql-sql by date

  From Date Subject
Next Message Chris Travers 2005-10-22 05:39:13 Re: Blank-padding
Previous Message Volkan YAZICI 2005-10-21 23:30:02 Re: Reading bytea field