Trying to apply migration scripts using the migrate_postgresql.sh script, I get the following:
ERROR: failed to fetch new tuple for AFTER trigger
This error occurs since the autocommit was set disabled for this script:
https://sourceforge.net/tracker/index.php?func=detail&aid=1913926&group_id=176962&atid=879332
I am using Postgresql 8.2.6
There have been some reports of this error on postgresql forums.
Tony
alter column function and trigger
Logged In: YES
user_id=1769708
Originator: YES
I have made some progress on this problem.
The PostgreSQL forums make mention of the error, but not in exactly the same circunstances.
They have fixed this in release 8.2.7, but I have not been able to test this.
In our case, the problem is due to the number of "insert into t_alter_colmn" statements, which fire the Rule alter_column_rule().
Without these statements or just a few of them, a single commit at the end works.
After trying many possible solutions, the one that finally worked was dropping the rule on t_alter_column and creating a trigger instead.
This also required changes to the altercolumn function.
So far I have not been able to fault this solution, but will do some more testing tomorrow
and think of how this change might be incorporated.
I have attached the code, for those who are interested.
Regards,
Tony
File Added: altercolumn_function_and_trigger.sql
Logged In: YES
user_id=1769708
Originator: YES
Unfortunately, I was eventually able to reproduce the same error,
using the trigger on table t_alter_column,
by running the migration scripts in branch 350.
At this stage it seems that running the migration scripts with autocommit turned off,
cannot be done reliably using PSQL program on PostgreSQL 8.2.6.
Will leave this bug open as the ERROR: failed to fetch new tuple for AFTER trigger,
shouldn't be happening, but will lower priority to 1.
Regards,
Tony
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).