Mercurial > gemma
changeset 4846:c69e35ec6adf
Explaining comment on constraint triggers
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 14 Nov 2019 14:53:15 +0100 |
parents | 8c46b845b406 |
children | 4847ac70103a |
files | schema/gemma.sql |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/schema/gemma.sql Thu Nov 14 14:36:41 2019 +0100 +++ b/schema/gemma.sql Thu Nov 14 14:53:15 2019 +0100 @@ -56,6 +56,19 @@ END; $$; +-- +-- Trigger functions to be used in constraint triggers +-- +/* The constraint triggers are subject to a possible race condition + due to PostgreSQL MVCC: Trigger functions do not see uncommited changes + of other transactions running in parallel. + + Since we serialize imports at application level, the race condition + should not happen, though. In case serialization at application level + should be removed, database side locking/serialization would have + to be applied. +*/ + -- Trigger function to be used as a constraint trigger to enforce uniqueness -- of geometries in the column with its name given as an argument to the -- trigger function