Oops.
Attached in the usual format this time.
Gavin
On Fri, 6 Aug 2004, Bruce Momjian wrote:
>
> Can I get a context diff please?
>
> ---------------------------------------------------------------------------
>
> Gavin Sherry wrote:
> > Attached is a minor patch to make BEFORE DELETE triggers honour tgenabled
> > properly.
> >
> > I know that we cannot, currently, use this feature through a DDL command
> > but just in case someone is updating the catalogs to do it and since it is
> > necessary in order to implement disabling of triggers, I thought I'd send
> > it in.
> >
> > Gavin
>
> Content-Description:
>
> [ Attachment, skipping... ]
>
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to [EMAIL PROTECTED] so that your
> > message can get through to the mailing list cleanly
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> [EMAIL PROTECTED] | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square, Pennsylvania 19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to [EMAIL PROTECTED] so that your
> message can get through to the mailing list cleanly
>
>
> !DSPAM:41144fb520531574347913!
>
>
Index: src/backend/commands/trigger.c
===================================================================
RCS file: /usr/local/cvsroot/pgsql-server/src/backend/commands/trigger.c,v
retrieving revision 1.166
diff -2 -c -r1.166 trigger.c
*** src/backend/commands/trigger.c 1 Jul 2004 00:50:11 -0000 1.166
--- src/backend/commands/trigger.c 5 Aug 2004 01:25:46 -0000
***************
*** 1350,1353 ****
--- 1350,1354 ----
TupleTableSlot *newSlot;
int i;
+ bool ret;
trigtuple = GetTupleForTrigger(estate, relinfo, tupleid, cid, &newSlot);
***************
*** 1366,1369 ****
--- 1367,1371 ----
LocTriggerData.tg_relation = relinfo->ri_RelationDesc;
LocTriggerData.tg_newtuple = NULL;
+ ret = true;
for (i = 0; i < ntrigs; i++)
{
***************
*** 1378,1382 ****
--- 1380,1387 ----
GetPerTupleMemoryContext(estate));
if (newtuple == NULL)
+ {
+ ret = false;
break;
+ }
if (newtuple != trigtuple)
heap_freetuple(newtuple);
***************
*** 1384,1388 ****
heap_freetuple(trigtuple);
! return (newtuple == NULL) ? false : true;
}
--- 1389,1393 ----
heap_freetuple(trigtuple);
! return (ret);
}
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly