Forum OpenACS Development: Response to Weird error invoking a plpgsql function (content_revision__delete)

The error in my previous message seems to be related to calling it from tcl within a db_transaction, because I just tried it from the psql command line and it worked. My tcl code implements a "revert" operation as follows:
    db_transaction {
	db_1row get_item_id ""

	db_dml set_live_revision ""
	set revision_list [db_list revisions_to_delete ""]

	foreach revision_id $revision_list {
	    db_exec_plsql delete_revision ""
So, given a revision_id that predates the current, live revision, the code makes it the live revision and deletes all those that follow it. Let me know if this helps you reproduce it.