Re: char/varchar truncation - Mailing list pgsql-hackers

From Tom Lane
Subject Re: char/varchar truncation
Date
Msg-id 640.1028348088@sss.pgh.pa.us
Whole thread Raw
In response to char/varchar truncation  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: char/varchar truncation  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-hackers
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> I wonder if we actually did the right thing with this.
> ...
> Wouldn't that mean the operation is supposed to succeed with
> diagnostic information since it's a completion condition not
> an exception condition?

Hm.  You are right: an explicit cast to varchar(n) has different
behavior according to the spec than a store assignment (ie,
implicit coercion) to varchar.  The implicit coercion should fail.

AFAIR our cast mechanisms aren't prepared to use two different
routines for these two cases.  Looks like we have some work to do.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Sponsored developers on web site
Next
From: Joe Conway
Date:
Subject: Re: FUNC_MAX_ARGS benchmarks