BUG #1381: invalid input syntax for integer: ""
The following bug has been logged online:
Bug reference: 1381
Logged by: Nicolas Addington
Email address: adding@math.wisc.edu
PostgreSQL version: 8.0
Operating system: aix
Description: invalid input syntax for integer: ""
Details:
When a pl/perl trigger for an insert event changes an integer column in the
new row to null, it fails. Interestingly, it doesn't have a problem if the
column was originally null.
create table tbl ( id integer primary key, n integer );
create function trg() returns trigger as $$
undef $_TD->{new}{n};
return 'MODIFY';
$$ language 'plperlu';
create trigger trg before insert on tbl for each row execute procedure
trg();
insert into tbl values (1, null);
INSERT 17997 1
insert into tbl values (2, 0);
ERROR: invalid input syntax for integer: ""
"Nicolas Addington" <adding@math.wisc.edu> writes:
PostgreSQL version: 8.0
tsk, tsk --- it's not 8.0. Yet.
When a pl/perl trigger for an insert event changes an integer column in the
new row to null, it fails. Interestingly, it doesn't have a problem if the
column was originally null.
Looks like we have to check *both* SvOK() and SvTYPE() everywhere.
Sigh. Done --- thanks for the report.
regards, tom lane
Nicolas Addington <adding@math.wisc.edu> writes:
tsk, tsk --- it's not 8.0. Yet.
That's just what the online bug reporting thing filled in...
Yeah, I know.
www folk: could we *please* get rid of the popup menu for versions in
the bug report form, and just have a text field to fill in? The amount
of time saved by the popup menu is minuscule, and I have gotten really
tired of people inserting WRONG INFORMATION BECAUSE THE BLEEDING FORM
WON'T LET THEM PUT IN CORRECT INFORMATION.
Sorry for shouting, but I've gotten more than tired of this constantly-
recurring problem.
regards, tom lane
Import Notes
Reply to msg id not found: Pine.SOC.4.61.0501110013370.7739@erdos.math.wisc.edu