pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rajat Katyal <rajatk@intelesoftech.com>
To: Uwe C. Schroeder <uwe@oss4u.com>
Cc: pgsql-general@postgresql.org
Subject: Re: value too long error
Date: Sat, 28 Feb 2004 14:06:54 +0530
Message-ID: <000a01c3fdd6$05d8aa60$2105a8c0@coffee> (raw)
References: <000a01c3fdc8$8adf1c70$2105a8c0@coffee>
	<200402272316.45130.uwe@oss4u.com>

Ya, through application we can provide field input validation but iam working on the tool which transfers the data from some specifed database to another. 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 postgres version 7.2 but not in postgres 7.3. 

At database level how can we provide a check if text size is greater than that of field size then truncate it?

Thanks and Regards,
Rajat.

----- Original Message ----- 
From: "Uwe C. Schroeder" <uwe@oss4u.com>
To: "Rajat Katyal" <rajatk@intelesoftech.com>; <pgsql-general@postgresql.org>
Sent: Saturday, February 28, 2004 12:46 PM
Subject: Re: [GENERAL] value too long error


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> Just don't try to save anything into a field that is too short to store the 
> value. Doesn't make too much sense, since what doesn't fit into the field 
> would be cut off anyways. If you need this, have your application either 
> restrict the input field length or cut the extensive part off before you 
> store it to the database.
> 
> 
> 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.
> 
> - -- 
> UC
> 
> - --
> 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)
> 
> iD8DBQFAQEBcjqGXBvRToM4RAv2TAKC8CmB4/pJWSk7H3/RDjn38RxBM4QCeKl/O
> CIf6DMxms1Y81DBd/9lHBwY=
> =b4bg
> -----END PGP SIGNATURE-----
> 

view thread (10+ messages)  latest in thread

Message-ID: <000a01c3fdd6$05d8aa60$2105a8c0@coffee>
Permalink:  ../000a01c3fdd6$05d8aa60$2105a8c0@coffee/
Also on:    postgresql.org/message-id/000a01c3fdd6$05d8aa60$2105a8c0@coffee

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: rajatk@intelesoftech.com, uwe@oss4u.com
  Subject: Re: value too long error
  In-Reply-To: <000a01c3fdd6$05d8aa60$2105a8c0@coffee>
  References: <000a01c3fdc8$8adf1c70$2105a8c0@coffee> <200402272316.45130.uwe@oss4u.com> <000a01c3fdd6$05d8aa60$2105a8c0@coffee>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox