Question about writing database functions in plpgsql.
Hi I am new to plpqsql and hope to understand functions.
I currently have a function called
But I want to check if the
How do I add a condition and modify the function to my needs?
I currently have a function called
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.But I want to check if the
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.How do I add a condition and modify the function to my needs?