Cannot use all four trigger events at once - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Cannot use all four trigger events at once
Date
Msg-id 4A39509B.6060803@turnstep.com
Whole thread Raw
Responses Re: Cannot use all four trigger events at once
Re: Cannot use all four trigger events at once
List pgsql-hackers
This was failing:

CREATE TRIGGER foo
AFTER INSERT OR UPDATE OR DELETE OR TRUNCATE
ON foobar
FOR EACH STATEMENT EXECUTE PROCEDURE baz();

Turns out the parser wasn't set up to handle four different trigger
event types. Patch attached.

--
Greg Sabino Mullane greg@endpoint.com  greg@turnstep.com
End Point Corporation 610-983-9073
PGP Key: 0x14964AC8 200906171620
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

Index: backend/parser/gram.y
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/parser/gram.y,v
retrieving revision 2.664
diff -r2.664 gram.y
3174c3174
<                     char *e = palloc(4);
---
>                     char *e = palloc(2);
3180c3180
<                     char *e = palloc(4);
---
>                     char *e = palloc(3);
3189a3190,3195
>             | TriggerOneEvent OR TriggerOneEvent OR TriggerOneEvent OR TriggerOneEvent
>                 {
>                     char *e = palloc(5);
>                     e[0] = $1; e[1] = $3; e[2] = $5; e[3] = $7; e[4] = '\0';
>                     $$ = e;
>                 }

Attachment

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Named transaction
Next
From: Greg Stark
Date:
Subject: Re: Named transaction