insert_document_contributor_by_update_documents which is triggered, as the function states, by an update in the documents table. This is the current version of the function.document_contributor table has an existing record with the match of document_id and contributor. Fyi, the document_contributor table is a join table that consists of only two columns stated above, document_id and contributor, and uses both of them as a composite primary key.