Re: ERROR: value too long for type character varying(255) - Mailing list pgsql-general

From Neil Conway
Subject Re: ERROR: value too long for type character varying(255)
Date
Msg-id 20020521162434.60fd83fb.nconway@klamath.dyndns.org
Whole thread Raw
In response to ERROR: value too long for type character varying(255)  (Doug Fields <dfields-pg-general@pexicom.com>)
Responses Re: ERROR: value too long for type character
Re: ERROR: value too long for type character varying(255)
List pgsql-general
On Tue, 21 May 2002 12:17:38 -0400
"Doug Fields" <dfields-pg-general@pexicom.com> wrote:
> In PG 7.1.3, ISTR I used to be able to submit any length I wished for a
> VARCHAR (and maybe a CHAR).
>
> Now, I'm at 7.2.1 and get these errors:
>
> ERROR:  value too long for type character varying(255)
>
> as JDBC Exceptions.
>
> Do you know how I can tell it to "silently truncate" the data as I believe
> it used to?

Is there a reason you can't just use TEXT? It will be stored the same
internally...

But the most obvious way I can think of to do what you're asking is
to define a rule to replace the value inserted with a call to
substring().

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Mysterious locking problem
Next
From: Doug Fields
Date:
Subject: Re: ERROR: value too long for type character