On Wed, 19 Nov 2003 14:50:24 -0500, Bruce Momjian wrote:
> Anyway, what did you want it to output? "AAA hey"? We could do
> that, but I assume most people wouldn't expect that output?
I certainly depends on their background. Personally, the padding
characteristics of the CHAR type was one of the first things about SQL
that I learned (the hard way). Oracle and DB2 people should be used to
PostgreSQL's old behaviour.
The CHAR type may seem strange to some, but they may then just
use VARCHAR.
> How do other databases handle this?
I've started writing about it here:
http://troels.arvin.dk/db/rdbms/#data_types-char
Some of my test-material is also online:
http://troels.arvin.dk/db/tests/chartest-20031119a/
My summary:
With regard to CHAR-handling, PostgreSQL 7.4 is now in opposition to
- previous versions of PostgreSQL; bad enough on its own,
because there doesn't seem to have been a good discussion
about it first - I can only find a few messages about it [1]
- DB2
- Oracle
- MSSQL (which also behaves in a non-standard way,
but different from PostgreSQL 7.4)
7.4 is close to how MySQL works, though.
I'm sorry about not testing this before 7.4 went gold, but I believe that
this is a bug which should be corrected before too much confusion
is created.
Reference 1:
An interesting one is this one:
http://article.gmane.org/gmane.comp.db.postgresql.devel.general/10958/match=char+padding
--
Greetings from Troels Arvin, Copenhagen, Denmark