Simplifying varchar and bpchar behavior - Mailing list pgsql-hackers

From Tom Lane
Subject Simplifying varchar and bpchar behavior
Date
Msg-id 18326.1053722088@sss.pgh.pa.us
Whole thread Raw
List pgsql-hackers
We have had a couple of threads recently on improving
bpchar/varchar/text behavior by making bpchar-to-text promotion
go through rtrim() (instead of being a straight binary-compatible
conversion) and getting rid of redundant operators:

http://archives.postgresql.org/pgsql-hackers/2002-11/msg00703.php
http://archives.postgresql.org/pgsql-performance/2003-05/msg00151.php

I'm going to go ahead and make these changes for 7.4, as they will
clearly improve the intuitiveness of the behavior.  I don't think they
move us any closer to spec compliance --- the spec appears to require
a notion of a collation sequence that can be specified independently
of the character datatype, which is something we don't have and aren't
likely to have very soon.  (It's not clear to me that it's actually
*useful* to specify NO PAD collation with fixed-width character data,
or PAD SPACE with varchar data, but the spec lets you do it.)  In the
meantime though these changes seem to be a win, and they will not leave
us any worse off when we do get around to implementing collations.

We speculated about a couple of alternative solutions in the first of
the above-mentioned threads, but they didn't look nearly as practical
to implement as this way.

Last call for objections ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Static snapshot data
Next
From: Peter Eisentraut
Date:
Subject: Re: Plan B for log rotation support: borrow Apache code