Thread: BUG #4364: type of "new.id" does not match that when preparing the plan

BUG #4364: type of "new.id" does not match that when preparing the plan

From
"Alexander Kirpa"
Date:
The following bug has been logged online:

Bug reference:      4364
Logged by:          Alexander Kirpa
Email address:      postgres@bilteks.com
PostgreSQL version: 8.3.1
Operating system:   FreeBSD 7.0
Description:        type of "new.id" does not match that when preparing the
plan
Details:

After change column type from integer to smallint
trigger function generate next error
----------
2008-08-19 20:50:30 EEST 42945 ERROR:  type of "new.id" does not match that
when preparing the plan
2008-08-19 20:50:30 EEST 42945 CONTEXT:  PL/pgSQL function
"job_tf_after_update" line 3 at IF
2008-08-19 20:50:30 EEST 42945 STATEMENT:  UPDATE job SET
processid=43057,job_starttime=now() WHERE id=2
----------- error line in trigger
IF NOT EQ(NEW.id,OLD.id) THEN
 RAISE EXCEPTION 'UPDATE id NOT ALLOWED';
END IF;
-----------
Workaround: touch trigger function