X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D523BD1E30B for ; Sat, 28 Feb 2004 08:36:35 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 88682-05 for ; Sat, 28 Feb 2004 04:36:19 -0400 (AST) Received: from sentry.bgitpl.com (unknown [61.11.64.51]) by svr1.postgresql.org (Postfix) with ESMTP id 7263AD1E309 for ; Sat, 28 Feb 2004 04:36:16 -0400 (AST) Received: from coffee (coffee.bgitpl.com [192.168.5.33]) by sentry.bgitpl.com (8.11.0/8.11.0) with SMTP id i1S8aP326240; Sat, 28 Feb 2004 14:06:25 +0530 Message-ID: <000a01c3fdd6$05d8aa60$2105a8c0@coffee> From: "Rajat Katyal" To: "Uwe C. Schroeder" Cc: References: <000a01c3fdc8$8adf1c70$2105a8c0@coffee> <200402272316.45130.uwe@oss4u.com> Subject: Re: value too long error Date: Sat, 28 Feb 2004 14:06:54 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0007_01C3FE04.1E6EAD80" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/1244 X-Sequence-Number: 57955 This is a multi-part message in MIME format. ------=_NextPart_000_0007_01C3FE04.1E6EAD80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Ya, through application we can provide field input validation but iam worki= ng on the tool which transfers the data from some specifed database to anot= her. Here user itself wants if value is too long for the target column then= truncates the text and insert into the target field. It was there in postg= res version 7.2 but not in postgres 7.3.=20 At database level how can we provide a check if text size is greater than t= hat of field size then truncate it? Thanks and Regards, Rajat. ----- Original Message -----=20 From: "Uwe C. Schroeder" To: "Rajat Katyal" ; Sent: Saturday, February 28, 2004 12:46 PM Subject: Re: [GENERAL] value too long error > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 >=20 > Just don't try to save anything into a field that is too short to store t= he=20 > value. Doesn't make too much sense, since what doesn't fit into the field= =20 > would be cut off anyways. If you need this, have your application either= =20 > restrict the input field length or cut the extensive part off before you= =20 > store it to the database. >=20 >=20 > On Friday 27 February 2004 11:00 pm, Rajat Katyal wrote: > > Hi: > > > > Whenever i try to insert the data, size of which is greater than that of > > column datatype size, I got the exception value too long for..... > > > > However this was not in postgresql7.2. > > > > Can anyone please tell me, is there any way so that i wont get this > > exception. Please help me as soon as possible > > > > Thanks in advance. > > > > Rajat. >=20 > - --=20 > UC >=20 > - -- > Open Source Solutions 4U, LLC 2570 Fleetwood Drive > Phone: +1 650 872 2425 San Bruno, CA 94066 > Cell: +1 650 302 2405 United States > Fax: +1 650 872 2417 > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.3 (GNU/Linux) >=20 > iD8DBQFAQEBcjqGXBvRToM4RAv2TAKC8CmB4/pJWSk7H3/RDjn38RxBM4QCeKl/O > CIf6DMxms1Y81DBd/9lHBwY=3D > =3Db4bg > -----END PGP SIGNATURE----- >=20 ------=_NextPart_000_0007_01C3FE04.1E6EAD80 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Ya, through application we= can=20 provide field input validation but iam working on the tool which trans= fers=20 the data from some specifed database to another. Here user itself wants if = value=20 is too long for the target column then truncates the text and insert into t= he=20 target field. It was there in postgres version 7.2 but not in postgres 7.3.= =20
 
At database level how can = we provide=20 a check if text size is greater than that of field size then truncate=20 it?
 
Thanks and Regards,=
Rajat.
 
----- Original Message -----
From: "Uwe C. Schroeder" <uwe@oss4u.com>
To: "Rajat Katyal" <rajatk@intelesoftech.com>= ;;=20 <pgsql-general@postgresql.org>
Sent: Saturday, February 28, 2004 12:46=20 PM
Subject: Re: [GENERAL] value too long=20 error

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>= =20
>
> Just don't try to save anything into a field that is too = short=20 to store the
> value. Doesn't make too much sense, since what doesn'= t fit=20 into the field
> would be cut off anyways. If you need this, have yo= ur=20 application either
> restrict the input field length or cut the exte= nsive=20 part off before you
> store it to the database.
>
> >=20 On Friday 27 February 2004 11:00 pm, Rajat Katyal wrote:
> >=20 Hi:
> >
> > Whenever i try to insert the data, size of wh= ich=20 is greater than that of
> > column datatype size,  I got the= =20 exception value too long for.....
> >
> > However this wa= s not=20 in postgresql7.2.
> >
> > Can anyone please tell me, is t= here=20 any way so that i wont get this
> > exception. Please help me as s= oon=20 as possible
> >
> > Thanks in advance.
> >
&g= t;=20 > Rajat.
>
> - --
> UC
>
> - --
>= Open=20 Source Solutions 4U, LLC 2570 Fleetwood Drive
> Phone:  +1 650 8= 72=20 2425 San Bruno, CA 94066
> Cell:   +1 650 302 2405 United= =20 States
> Fax:    +1 650 872 2417
> -----BEGIN PG= P=20 SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
>
>= =20 iD8DBQFAQEBcjqGXBvRToM4RAv2TAKC8CmB4/pJWSk7H3/RDjn38RxBM4QCeKl/O
>=20 CIf6DMxms1Y81DBd/9lHBwY=3D
> =3Db4bg
> -----END PGP=20 SIGNATURE-----
>
------=_NextPart_000_0007_01C3FE04.1E6EAD80--