On Wed, May 22, 2019 at 3:41 PM PegoraroF10 <marcos@xxxxxxxxxx> wrote:
I´m not saying it should inspect function code, but I think it should deny
when I try to create a trigger missing a needed argument.
Guessing you missed my earlier response...
When I do ...
create table MyTable(integer);
gives me an "syntax error at end of input" because I forgot field name.
why when I do ...
create trigger MyTrigger after insert on MyTable execute procedure
MyFunction();
It does not gives me something similar ?
CREATE [ CONSTRAINT ] TRIGGER name { BEFORE | AFTER | INSTEAD OF } { event [ OR ... ] }
ON table_name[ FROM referenced_table_name ]
[ NOT DEFERRABLE | [ DEFERRABLE ] [ INITIALLY IMMEDIATE | INITIALLY DEFERRED ] ]
[ REFERENCING { { OLD | NEW } TABLE [ AS ] transition_relation_name } [ ... ] ]
[ FOR [ EACH ] { ROW | STATEMENT } ]
[ WHEN ( condition ) ]
EXECUTE PROCEDURE function_name ( arguments )
The part about { ROW | STATEMENT } is within an optional clause.
David J.