Ben, there might be a bug in the postgresql version, I could not find it right away. I am too tired right now :)
We will be looking into it more as we migrate the site over. I took out the code that recurses on the context_id tree and the function does work in that limited capacity, but only updates the object_id that is passed in.