]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix plpython's handling of functions used as triggers on multiple tables.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 25 Jan 2013 21:59:05 +0000 (16:59 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 25 Jan 2013 21:59:05 +0000 (16:59 -0500)
commit17dee323e7ff67863582f279e415a8228e0b99cd
tree5b334b0273f17415e862143e1e1d38fe54886202
parent812451d1c7a0ad298cdf3a5e04bd3e9d1d700664
Fix plpython's handling of functions used as triggers on multiple tables.

plpython tried to use a single cache entry for a trigger function, but it
needs a separate cache entry for each table the trigger is applied to,
because there is table-dependent data in there.  This was done correctly
before 9.1, but commit 46211da1b84bc3537e799ee1126098e71c2428e8 broke it
by simplifying the lookup key from "function OID and triggered table OID"
to "function OID and is-trigger boolean".  Go back to using both OIDs
as the lookup key.  Per bug report from Sandro Santilli.

Andres Freund
src/pl/plpython/expected/plpython_trigger.out
src/pl/plpython/plpython.c
src/pl/plpython/sql/plpython_trigger.sql