Re: string cast/compare broken? - Mailing list pgsql-hackers

From Zeugswetter Andreas SB SD
Subject Re: string cast/compare broken?
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA4961E1E@m0114.s-mxs.net
Whole thread Raw
In response to string cast/compare broken?  (Scott Royston <scroyston@mac.com>)
Responses Re: string cast/compare broken?  ("John Liu" <johnl@synthesys.com>)
Re: string cast/compare broken?  (Andrew Sullivan <andrew@libertyrms.info>)
List 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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: string cast/compare broken?
Next
From: Stephan Szabo
Date:
Subject: Re: string cast/compare broken?