Glitch in the custom DDL documentation / postgresql trigger correction
Issue #4037
new
In the trigger
definition near line 62 of doc/build/core/ddl.rst
(sorry, could not find the proper syntax to hyperlink that line), where it is explicitly showing an example for PostgreSQL, the DDL
uses a syntax which is not valid for a PG trigger:
CREATE TRIGGER dt_ins BEFORE INSERT ON mytable
FOR EACH ROW BEGIN SET NEW.data='ins'; END
Accordingly to the documentation a trigger cannot execute an arbitrary code block, but must run a procedure, so for example it could be written as:
CREATE TRIGGER dt_ins BEFORE INSERT ON mytable
FOR EACH ROW EXECUTE PROCEDURE set_data_field('ins');
Comments (3)
-
repo owner -
repo owner - changed title to Glitch in the custom DDL documentation / postgresql trigger correction
- changed component to postgres
-
repo owner - changed milestone to 1.x.xx
-
assigned issue to
- Log in to comment
oh, well it seems triggers aren't running for postgresql in the tests either since we have to figure out this syntax.
we need this one in the test suite to work in particular: