Re: [GENERAL] 'value too long' and before insert/update trigger

2017-08-24 Thread Tom Lane
"David G. Johnston" writes: > On Wednesday, August 23, 2017, Kevin Golding > wrote: >> Presumably the length validation is being done before the trigger is run. >> Is there some way this could be changed so the trigger happens first? > The input tuple passed into the trigger is a valid record of

Re: [GENERAL] 'value too long' and before insert/update trigger

2017-08-23 Thread David G. Johnston
On Wednesday, August 23, 2017, Kevin Golding wrote: > Presumably the length validation is being done before the trigger is run. > Is there some way this could be changed so the trigger happens first? > The input tuple passed into the trigger is a valid record of the same type as the table to whi

Re: [GENERAL] 'value too long' and before insert/update trigger

2017-08-23 Thread Pavel Stehule
Hi 2017-08-24 7:08 GMT+02:00 Kevin Golding : > Hi all > I'm currently migrating a legacy Informix 4gl application to run on > PostgreSQL (v9.5.8) > > There are errors occurring because sometimes the application tries to > insert/update values longer than the definition of the database column. > T

Re: [GENERAL] 'value too long' and before insert/update trigger

2017-08-23 Thread Charles Clavadetscher
Hi > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Kevin Golding > Sent: Donnerstag, 24. August 2017 07:08 > To: pgsql-general@postgresql.org > Subject: [GENERAL] 'value too long' and

[GENERAL] 'value too long' and before insert/update trigger

2017-08-23 Thread Kevin Golding
Hi all I'm currently migrating a legacy Informix 4gl application to run on PostgreSQL (v9.5.8) There are errors occurring because sometimes the application tries to insert/update values longer than the definition of the database column. The error message is eg. "value too long for type character

Re: [GENERAL] Value to long for type ....: Columnname missing

2012-04-16 Thread Andreas Kretschmer
Thomas Guettler wrote: > Am 13.04.2012 20:35, schrieb Scott Marlowe: >> On Thu, Apr 12, 2012 at 2:16 AM, Thomas Guettler wrote: >>> Hi, >>> >>> I think it would be very good, if postgresql reports which column is too >>> small: >>> >>>Value to long for type character varying(1024) (message t

Re: [GENERAL] Value to long for type ....: Columnname missing

2012-04-16 Thread Thomas Guettler
Am 13.04.2012 20:35, schrieb Scott Marlowe: On Thu, Apr 12, 2012 at 2:16 AM, Thomas Guettler wrote: Hi, I think it would be very good, if postgresql reports which column is too small: Value to long for type character varying(1024) (message translated from german to english) Is there a rea

Re: [GENERAL] Value to long for type ....: Columnname missing

2012-04-13 Thread Scott Marlowe
On Thu, Apr 12, 2012 at 2:16 AM, Thomas Guettler wrote: > Hi, > > I think it would be very good, if postgresql reports which column is too > small: > >   Value to long for type character varying(1024) (message translated from > german to english) > > Is there a reason not to report the column name

Re: [GENERAL] Value to long for type ....: Columnname missing

2012-04-13 Thread Guillaume Lelarge
On Fri, 2012-04-13 at 17:19 +0400, Sergey Konoplev wrote: > On Thu, Apr 12, 2012 at 12:16 PM, Thomas Guettler wrote: > > How can you report feature request? > > You can submit it here http://www.postgresql.org/support/submitbug/ > No, this allows you to report a bug, not a feature request. --

Re: [GENERAL] Value to long for type ....: Columnname missing

2012-04-13 Thread Sergey Konoplev
On Thu, Apr 12, 2012 at 12:16 PM, Thomas Guettler wrote: > How can you report feature request? You can submit it here http://www.postgresql.org/support/submitbug/ > >  Thomas Güttler > > > > -- > Thomas Guettler, http://www.thomas-guettler.de/ > E-Mail: guettli (*) thomas-guettler + de > > -- >

[GENERAL] Value to long for type ....: Columnname missing

2012-04-12 Thread Thomas Guettler
Hi, I think it would be very good, if postgresql reports which column is too small: Value to long for type character varying(1024) (message translated from german to english) Is there a reason not to report the column name? How can you report feature request? Thomas Güttler -- Thomas

[GENERAL] Value to long for type ....: Columnname missing

2012-04-11 Thread Thomas Guettler
Hi, I think it would be very good, if postgresql reports which column is too small: Value to long for type character varying(1024) (message translated from german to english) Is there a reason not to report the column name? How can you report feature request? Thomas Güttler -- Thomas

Re: [GENERAL] value too long - but for which column?

2011-10-18 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Alexander Farber Sent: Tuesday, October 18, 2011 3:44 PM To: pgsql-general Subject: [GENERAL] value too long - but for which column? Hello, I see the errors ERROR: value

[GENERAL] value too long - but for which column?

2011-10-18 Thread Alexander Farber
Hello, I see the errors ERROR: value too long for type character varying(32) CONTEXT: SQL statement "update pref_users set first_name = $1 , last_name = $2 , female = $3 , avatar = $4 , city = $5 , last_ip = $6 , login = now() where id = $7 " PL/pgSQL function "pref_update_users"

Re: [GENERAL] value

2010-09-16 Thread Gissur Þórhallsson
> > OK, but you still need to be careful. That trick will only work if you > insert rows one at a time into the table. If you have a single insert > that inserts multiple rows (as in my example), it would fail because > the currval() call would return the same value for each row in the > insert cre

Re: [GENERAL] value

2010-09-16 Thread Dean Rasheed
2010/9/16 Gissur Þórhallsson : >> which is probably not what you might expect. > > No, indeed it is not. > My solution - which seems to be working - is replacing: > new.my_table_id > with: > currval(pg_get_serial_sequence('my_table', 'my_table_id')) > in the on_insert rule > OK, but you still need

Re: [GENERAL] value

2010-09-16 Thread Gissur Þórhallsson
> > which is probably not what you might expect. > No, indeed it is not. My solution - which seems to be working - is replacing: new.my_table_id with: currval(pg_get_serial_sequence('my_table', 'my_table_id')) in the on_insert rule This does the trick. Thanks, Gissur Þórhallsson Loftmyndir ehf.

Re: [GENERAL] value

2010-09-16 Thread Dean Rasheed
2010/9/16 Gissur Þórhallsson : >> Yes.  You're using RULEs where TRIGGERs would do.  Change to TRIGGERs. > > While this could possibly solve my problem in particular; it doesn't explain > why this is happening. > Is this somehow expected behavior on an INSERT rule? > Rules can be pretty tricky thi

Re: [GENERAL] value

2010-09-16 Thread Gissur Þórhallsson
> > Yes. You're using RULEs where TRIGGERs would do. Change to TRIGGERs. > While this could possibly solve my problem in particular; it doesn't explain why this is happening. Is this somehow expected behavior on an INSERT rule? PS. It seems that I forgot to create a meaningful subject in my or

Re: [GENERAL] value

2010-09-15 Thread David Fetter
On Wed, Sep 15, 2010 at 03:16:55PM +, Gissur Þórhallsson wrote: > Hi there, > > I have a somewhat peculiar problem. > > To begin with, here are links to my schema and rules: my_table and > associated rules and > my_table_history

[GENERAL] value

2010-09-15 Thread Gissur Þórhallsson
Hi there, I have a somewhat peculiar problem. To begin with, here are links to my schema and rules: my_table and associated rules and my_table_history Scene: I'm implementing a pretty standard history keeping mec

Re: [GENERAL] Value of serial data type after insert.

2004-11-13 Thread Michael Fuhr
On Wed, Nov 10, 2004 at 02:34:22PM -0500, Ernest Kim wrote: > I was wondering if there was a way to get the value of serial data > type after an insert. Use currval(): http://www.postgresql.org/docs/7.4/static/functions-sequence.html Race condtions aren't a problem: "Notice that because this i

[GENERAL] Value of serial data type after insert.

2004-11-13 Thread Ernest Kim
I was wondering if there was a way to get the value of serial data type after an insert. For example, you have the following table: create table my_names ( id serial unique, name varchar(10) ); And then you do the following: insert into my_names values ('Ernie'); How

Re: [GENERAL] value too long error

2004-06-08 Thread Richard Huxton
On Saturday 28 February 2004 08:36, Rajat Katyal wrote: > 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

Re: [GENERAL] value too long error

2004-03-01 Thread scott.marlowe
On Sat, 28 Feb 2004, 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