Unix Technical Forum

BUG #2089: Documentation bug: Triggers in plpythonu

This is a discussion on BUG #2089: Documentation bug: Triggers in plpythonu within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2089 Logged by: Jozef Behran Email address: jozef.behran@krs.sk PostgreSQL version: ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:31 AM
Jozef Behran
 
Posts: n/a
Default BUG #2089: Documentation bug: Triggers in plpythonu


The following bug has been logged online:

Bug reference: 2089
Logged by: Jozef Behran
Email address: jozef.behran@krs.sk
PostgreSQL version: 8.1.0
Operating system: Short answer: Mandrake 10.2. Long answer: Linux sarkan
2.6.11-6mdk #1 Tue Mar 22 16:04:32 CET 2005 i686 AMD Athlon(tm) Processor
unknown GNU/Linux
Description: Documentation bug: Triggers in plpythonu
Details:

A trigger in plpythonu cannot use the `args' list to obtain the arguments
and does not return the row to be written into the database. Instead the
arguments are placed into a global dictionary called "TD". The row is in
TD["new"] as a dictionary keyed by the names of the fields (the values are
the values of the field). The trigger is supposed to return "SKIP" (or
None?) if it wants the operation to be skipped or modify the TD["new"] to
the actual content to be written into the database and then return "MODIFY".

---------------------------(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
  #2 (permalink)  
Old 04-10-2008, 10:32 AM
Alvaro Herrera
 
Posts: n/a
Default Re: BUG #2089: Documentation bug: Triggers in plpythonu

Jozef Behran wrote:

> A trigger in plpythonu cannot use the `args' list to obtain the arguments
> and does not return the row to be written into the database. Instead the
> arguments are placed into a global dictionary called "TD". The row is in
> TD["new"] as a dictionary keyed by the names of the fields (the values are
> the values of the field). The trigger is supposed to return "SKIP" (or
> None?) if it wants the operation to be skipped or modify the TD["new"] to
> the actual content to be written into the database and then return "MODIFY".


I don't see how is this a bug. It's perfectly documented in the
"Trigger functions" section, here:

http://www.postgresql.org/docs/8.1/s...n-trigger.html

If this is not what you meant, please explain.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 10:33 AM
Jozef Behran
 
Posts: n/a
Default Re: BUG #2089: Documentation bug: Triggers in plpythonu

> > A trigger in plpythonu cannot use the `args' list to obtain the
> > arguments and does not return the row to be written into the
> > database. Instead the arguments are placed into a global
> > dictionary called "TD". The row is in TD["new"] as a dictionary
> > keyed by the names of the fields (the values are the values of
> > the field). The trigger is supposed to return "SKIP" (or None?)
> > if it wants the operation to be skipped or modify the TD["new"]
> > to the actual content to be written into the database and then
> > return "MODIFY".

>
> I don't see how is this a bug. It's perfectly documented in the
> "Trigger functions" section, here:


The problem was that I mistakenly read manual for the 8.0 version,
in which this is not documented (or at least no link is created from
the "trigger functions". There is no such bug in 8.1 manual and since
I use version 8.1.0 now, this does not matter.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

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 05:51 AM.


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