Forum .LRN Q&A: Context_id bug in forums for postgresql 7.1

Collapse
Posted by Dave Bauer on

I have tracked down the context_id error in the postgresql version of forums, i think.

The pl/pgsql function forum_message__new takes context_id as an argument and uses that to set the context_id of the acs_object for the forums_message object. The oracle version of the function uses nvl(p_context_id, p_forum_id) so that if no context_id is passed, the forum_id is used.

I tried to copy this in postgresql using coalesce(p_context_id, p_forum_id) and it does the the context_id correctly.

The problem arises when

perform acs_object__update_last_modified(p_forum_id);
is called. This error occurs:
ERROR:  triggered data change violation on relation "acs_object_co
ntext_index"

Any ideas on how to fix this? Switch to postgresql 7.2?