You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This means it would be great (e.g. for integration testing), if we could support PG triggers anyway as follow:
There's a naming convention for trigger_name -> trigger_name_function
jOOQ controls the lifecycle of the trigger function, assuming it is never manipulated outside of jOOQ
Creating the trigger creates the function
Caveat: The function has to be re-created when the trigger doesn't exist. This could happen, for example, when the table is dropped and re-created, in case of which the trigger is also dropped, but not the trigger function!
Dropping a table doesn't cascade to deleting the trigger function. I'm not sure if this can be done?
But it means that we must always CREATE OR REPLACE the trigger function (nope, the function is created before the trigger, so CREATE OR REPLACE would succeed even if CREATE TRIGGER fails)
The text was updated successfully, but these errors were encountered:
PostgreSQL doesn't support inline trigger bodies, only references to stored functions "returning a trigger," see:
For this reason, we haven't supported them yet in our DDL API, because ordinary triggers from other RDBMS can't be mapped to PostgreSQL easily.
jOOQ 3.19 now adds more support for triggers, e.g. in the form of runtime meta model / code generation support:
This means it would be great (e.g. for integration testing), if we could support PG triggers anyway as follow:
trigger_name
->trigger_name_function
Related
Caveats:
ERROR: transition table name can only be specified for an AFTER trigger
ERROR: transition tables cannot be specified for triggers with more than one event
ERROR: transition tables cannot be specified for triggers with column lists
RETURN NEW
, instead of justRETURN
RETURN
byRETURN NEW
Unresolved caveats:
But it means that we must always(nope, the function is created before the trigger, soCREATE OR REPLACE
the trigger functionCREATE OR REPLACE
would succeed even ifCREATE TRIGGER
fails)The text was updated successfully, but these errors were encountered: