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(); }