From 09d5461d0185c2619b348855b067e5ba0971ad95 Mon Sep 17 00:00:00 2001 From: eelke Date: Sat, 5 Oct 2019 08:55:02 +0200 Subject: [PATCH] Seperate event types in the trigger definition with OR --- pglablib/catalog/PgTrigger.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pglablib/catalog/PgTrigger.cpp b/pglablib/catalog/PgTrigger.cpp index ba1ef9c..920a612 100644 --- a/pglablib/catalog/PgTrigger.cpp +++ b/pglablib/catalog/PgTrigger.cpp @@ -91,12 +91,18 @@ QString PgTrigger::event() const QString event; if (type & TriggerTypeInsert) event += "INSERT "; - if (type & TriggerTypeUpdate) + if (type & TriggerTypeUpdate) { + if (!event.isEmpty()) event += "OR "; event += "UPDATE "; - if (type & TriggerTypeDelete) + } + if (type & TriggerTypeDelete) { + if (!event.isEmpty()) event += "OR "; event += "DELETE "; - if (type & TriggerTypeTruncate) + } + if (type & TriggerTypeTruncate) { + if (!event.isEmpty()) event += "OR "; event += "TRUNCATE"; + } return event.trimmed(); }