The following bug has been logged online:

Bug reference:      1381
Logged by:          Nicolas Addington
Email address:      [EMAIL PROTECTED]
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: ""

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to