Re:PL/Rust 1.0: now a trusted language for Postgres
by ttfkam on Sunday April 09, 2023 @05:16PM
(#35506548)
Event triggers fire on DDL changes, not DML. You're thinking of statement-level triggers.
As far as event triggers and DO-blocks, that omission seems fine to me. Especially DO-blocks, which are essentially an inline code, one-off escape hatch in the middle of other SQL. Rust would not be helping any performance-sensitive critical paths in those cases.
Re:PL/Rust 1.0: now a trusted language for Postgres
by doctor_eval on Sunday April 09, 2023 @05:25PM
(#35506627)
True, but it’s sometimes useful for experimenting, REPL style.
Re:PL/Rust 1.0: now a trusted language for Postgres
by samanator on Sunday April 09, 2023 @05:52PM
(#35506818)
You're right! My mistake. I was thinking of statement triggers.
https://www.postgresql.org/docs/current/sql-createtrigger.ht...
> The REFERENCING option enables collection of transition relations
I don't see any examples of statement triggers...
Re:PL/Rust 1.0: now a trusted language for Postgres
by ttfkam on Sunday April 09, 2023 @10:51PM
(#35508705)
https://stackoverflow.com/a/72397774
Note the use of new_table and old_table as aliases. Instead of single records in NEW and OLD, you can select against new and old sets of records.
> Event Triggers and DO blocks are not (yet) supported by PL/Rust.