VARCHAR truncation - Mailing list pgsql-general

From David Wall
Subject VARCHAR truncation
Date
Msg-id arbugv$14vr$1@news.hub.org
Whole thread Raw
List pgsql-general
Is there a way in a table with, for example, a VARCHAR(250) to have it
truncate any string I send that's longer?  Right now, it throws an
exception: ERROR:  value too long for type character varying(250)

I'd prefer that my mainline code doesn't know about the lengths of strings
in the database because they sometimes vary depending on the db backend
(Oracle only allows one LONG string, for example, so if my PG has two, these
are often ported as under Oracle as two VARCHAR2 fields).

Thanks,
David



pgsql-general by date:

Previous
From: * Tong *
Date:
Subject: Re: Authorise root as postgres
Next
From: "David Wall"
Date:
Subject: Re: VARCHAR truncation