Re: string cast/compare broken?

From: "Zeugswetter Andreas SB SD" <ZeugswetterA(at)spardat(dot)at>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Hannu Krosing" <hannu(at)tm(dot)ee>, "Scott Royston" <scroyston(at)mac(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: string cast/compare broken?
Date: 2002-07-12 13:48:59
Message-ID: 46C15C39FEB2C44BA555E356FBCD6FA4961E1E@m0114.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> Has anyone studied how other DBMSs handle CHAR vs VARCHAR? Judging
> from the number of questions we get on this point, I have to wonder
> if we are not out of step with the way other systems do it.

Well, I already gave the Informix example, that compares them as equal.
(they obviously coerce varchar to char)

In nearly all cases I have seen so far the different handling of trailing
blanks is not wanted. In most of these varchar is simply used instead of char to
save disk space.

In Informix ESQL/C there is a host variable type CSTRINGTYPE that automatically
rtrims columns of char type upon select.

Imho the advantages of an automatic coercion would outweigh the few corner cases
where the behavior would not be intuitive to everybody.

Andreas

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2002-07-12 14:16:58 Re: string cast/compare broken?
Previous Message Tom Lane 2002-07-12 13:16:58 Re: string cast/compare broken?