Unix Technical Forum

tg_trigtuple not NULL in AFTER STATEMENT triggers?

This is a discussion on tg_trigtuple not NULL in AFTER STATEMENT triggers? within the pgsql Hackers forums, part of the PostgreSQL category; --> I've noticed that tg_trigtuple and tg_newtuple aren't cleared to NULL in AFTER STATEMENT triggers. Is that an oversight, or ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 03:47 AM
Michael Fuhr
 
Posts: n/a
Default tg_trigtuple not NULL in AFTER STATEMENT triggers?

I've noticed that tg_trigtuple and tg_newtuple aren't cleared to
NULL in AFTER STATEMENT triggers. Is that an oversight, or does
the code intentionally not bother because trigger functions shouldn't
be referencing those members in statement-level triggers anyway, or
is there some other reason?

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-12-2008, 03:47 AM
Tom Lane
 
Posts: n/a
Default Re: tg_trigtuple not NULL in AFTER STATEMENT triggers?

Michael Fuhr <mike@fuhr.org> writes:
> I've noticed that tg_trigtuple and tg_newtuple aren't cleared to
> NULL in AFTER STATEMENT triggers. Is that an oversight,


Probably. Send a patch?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-12-2008, 03:47 AM
Michael Fuhr
 
Posts: n/a
Default Re: tg_trigtuple not NULL in AFTER STATEMENT triggers?

On Mon, Jul 31, 2006 at 11:12:14AM -0400, Tom Lane wrote:
> Michael Fuhr <mike@fuhr.org> writes:
> > I've noticed that tg_trigtuple and tg_newtuple aren't cleared to
> > NULL in AFTER STATEMENT triggers. Is that an oversight,

>
> Probably. Send a patch?


Sure. Is the switch in AfterTriggerExecute() around line 2116 in
commands/trigger.c close to where I should be looking?

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-12-2008, 03:47 AM
Tom Lane
 
Posts: n/a
Default Re: tg_trigtuple not NULL in AFTER STATEMENT triggers?

Michael Fuhr <mike@fuhr.org> writes:
> On Mon, Jul 31, 2006 at 11:12:14AM -0400, Tom Lane wrote:
>> Michael Fuhr <mike@fuhr.org> writes:
>>> I've noticed that tg_trigtuple and tg_newtuple aren't cleared to
>>> NULL in AFTER STATEMENT triggers. Is that an oversight,

>>
>> Probably. Send a patch?


> Sure. Is the switch in AfterTriggerExecute() around line 2116 in
> commands/trigger.c close to where I should be looking?


Yeah, it looks like some attention needs to be paid to whether
ate_oldctid and ate_newctid were supplied, rather than just blindly
passing pointers to possibly-uninitialized local structs.

Offhand I think you could remove the "switch" entirely in favor of
driving the setup of these fields off the "if (ItemPointerIsValid(..."
tests.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:26 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com