Routines

Routines

Name Type Language Deterministic Return Type Security Restriction Comments
trig_b_iu_syst_enum_items_validate_functional_types() FUNCTION plpgsql false trigger INVOKER

Ensures that if the parent syst_enums record has syst_enum_functional_types records defined, a syst_enum_items record will reference one of those functional types.

Trigger Function Details:

  • Supported Timing: BEFORE

  • Supported Operations: INSERT, UPDATE

General Usage

Note that this trigger function is intended to be use by constraint triggers.

trig_a_iu_syst_enum_items_maintain_sort_order() FUNCTION plpgsql false trigger INVOKER

Automatically maintains the sort order of syst_enum_item records in cases where sort ordering collides with existing syst_enum_items records for the same enum_id.

Trigger Function Details:

  • Supported Timing: AFTER

  • Supported Operations: INSERT, UPDATE

General Usage

On insert or update when the new sort_order value matches that of an existing record for the enumeration, the system will sort the match record after the new/updated record. This will cascade for all syst_enum_items records matching the enum_id until the last one is updated.

trig_b_i_syst_enum_functional_type_validate_new_allowed() FUNCTION plpgsql false trigger INVOKER

Checks to see if this is the first functional type being added for the enumeration and, if so, that no syst_enum_items records already exist.

Trigger Function Details:

  • Supported Timing: BEFORE

  • Supported Operations: INSERT

General Usage

Adding a first functional type for an enumeration which already has defined enumeration items implies that the enumeration items must be assigned a functional type in the same operation to keep data consistency. In practice, this would be difficult since there would almost certainly have to be multiple functional types available in order to avoid making bogus assignments; it would be much more difficult to manage such a process as compared to simply disallowing the scenario.

trig_b_i_syst_enum_items_maintain_sort_order() FUNCTION plpgsql false trigger INVOKER

For INSERTed records with a null sort_order value, this trigger will assign a default value assuming the new record should be inserted at the end of the sort.

Trigger Function Details:

  • Supported Timing: BEFORE

  • Supported Operations: INSERT

General Usage

If the inserted record was already assigned a sort_order value, the inserted value is respected.