Unix Technical Forum

Writing Python triggers and the TD dictionary value

This is a discussion on Writing Python triggers and the TD dictionary value within the pgsql Novice forums, part of the PostgreSQL category; --> I can't figure out the plpython syntax to use the TD dictionary values. For example, say I have a ...


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

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 09:36 PM
Curt Schwaderer
 
Posts: n/a
Default Writing Python triggers and the TD dictionary value

I can't figure out the plpython syntax to use the TD dictionary values. For example, say I have a column "foo" in table X that has a python trigger defined for it.
The documentation says that TD["old"] will have the original value of the row and TD["new"] will have the new value of the row. I want to get column foo out of TD["old"] and TD["new"]. But everything I try gives me an error:

TD["old"][foo]
TD["old"].foo
TD["old"](foo)

The Perl documentation shows the syntax for this, but the Python version doesn't. Thanks much for any information on the syntax for this!
Please email to curt.schwaderer@mchsi.com

Curt
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 09:36 PM
Michael Fuhr
 
Posts: n/a
Default Re: Writing Python triggers and the TD dictionary value

On Fri, Feb 17, 2006 at 08:50:47AM -0600, Curt Schwaderer wrote:
> TD["old"][foo]
> TD["old"].foo
> TD["old"](foo)


TD["old"]["foo"]

--
Michael Fuhr

---------------------------(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 11:38 AM.


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