Re: char/varchar truncation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: char/varchar truncation
Date: 2002-08-03 04:14:48
Message-ID: 640.1028348088@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2002-08-03 06:00:47 Re: FUNC_MAX_ARGS benchmarks
Previous Message Bruce Momjian 2002-08-03 04:11:05 Sponsored developers on web site