Re: Should there be a charcat? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Should there be a charcat?
Date
Msg-id 5437.1160165442@sss.pgh.pa.us
Whole thread Raw
In response to Should there be a charcat?  ("Jim C. Nasby" <jim@nasby.net>)
Responses Re: Should there be a charcat?  ("Jim C. Nasby" <jim@nasby.net>)
List pgsql-hackers
"Jim C. Nasby" <jim@nasby.net> writes:
> I would think that c || 'x' would result in 'x                    x',
> but it doesn't

We did it that way up through 7.3, but changed because we concluded the
behavior was inconsistent.  The behavior of char(N) these days is that
the padding spaces are not semantically significant, which means that
they effectively are not there for anything except display purposes.

If we didn't do this, we would have situations where, for example,
A = B but (A || 'x') != (B || 'x').  Does that strike you as a good idea?

If you're interested you can probably find more discussion in the
archives from mid-2003 or so.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Should there be a charcat?
Next
From: Stephen Frost
Date:
Subject: array_accum aggregate