VARCHAR truncation

From: "David Wall" <d(dot)wall(at)computer(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: VARCHAR truncation
Date: 2002-11-18 23:53:00
Message-ID: arbugv$14vr$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2002-11-18 23:53:19 Re: More time manipulation..
Previous Message Robert Treat 2002-11-18 22:38:09 Re: Looking for a "Linux on Playstation 2" person