postgresql/src/include
Kevin Grittner 6868ed7491 Throw error if expiring tuple is again updated or deleted.
This prevents surprising behavior when a FOR EACH ROW trigger
BEFORE UPDATE or BEFORE DELETE directly or indirectly updates or
deletes the the old row.  Prior to this patch the requested action
on the row could be silently ignored while all triggered actions
based on the occurence of the requested action could be committed.
One example of how this could happen is if the BEFORE DELETE
trigger for a "parent" row deleted "children" which had trigger
functions to update summary or status data on the parent.

This also prevents similar surprising problems if the query has a
volatile function which updates a target row while it is already
being updated.

There are related issues present in FOR UPDATE cursors and READ
COMMITTED queries which are not handled by this patch.  These
issues need further evalution to determine what change, if any, is
needed.

Where the new error messages are generated, in most cases the best
fix will be to move code from the BEFORE trigger to an AFTER
trigger.  Where this is not feasible, the trigger can avoid the
error by re-issuing the triggering statement and returning NULL.

Documentation changes will be submitted in a separate patch.

Kevin Grittner and Tom Lane with input from Florian Pflug and
Robert Haas, based on problems encountered during conversion of
Wisconsin Circuit Court trigger logic to plpgsql triggers.
2012-10-26 14:55:36 -05:00
..
access Throw error if expiring tuple is again updated or deleted. 2012-10-26 14:55:36 -05:00
bootstrap Fix management of pendingOpsTable in auxiliary processes. 2012-07-18 15:28:10 -04:00
catalog When converting a table to a view, remove its system columns. 2012-10-24 13:39:37 -04:00
commands refactor ALTER some-obj SET OWNER implementation 2012-10-03 18:07:46 -03:00
datatype Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
executor Split tuple struct defs from htup.h to htup_details.h 2012-08-30 16:52:35 -04:00
foreign Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
lib Remove unnecessary "head" arguments from some dlist/slist functions. 2012-10-18 19:04:20 -04:00
libpq Add API for 64-bit large object access. Now users can access up to 2012-10-07 08:36:48 +09:00
mb Fix bogus macro definition. 2012-07-10 22:36:11 -04:00
nodes Fix planning of non-strict equivalence clauses above outer joins. 2012-10-18 12:30:10 -04:00
optimizer Fix planning of non-strict equivalence clauses above outer joins. 2012-10-18 12:30:10 -04:00
parser Allow OLD and NEW in multi-row VALUES within rules. 2012-08-19 14:12:16 -04:00
port Remove checks for now long outdated compilers. 2012-09-28 19:43:50 -04:00
portability
postmaster Support having multiple Unix-domain sockets per postmaster. 2012-08-10 17:27:15 -04:00
regex Re-implement extraction of fixed prefixes from regular expressions. 2012-07-10 14:54:37 -04:00
replication Improve replication connection timeouts. 2012-10-11 17:48:08 +03:00
rewrite Centralize the logic for detecting misplaced aggregates, window funcs, etc. 2012-08-10 11:36:15 -04:00
snowball Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
storage Close un-owned SMgrRelations at transaction end. 2012-10-17 12:38:21 -04:00
tcop Remove execdesc.h inclusion from tcopprot.h 2012-09-20 11:07:59 -03:00
tsearch Replace int2/int4 in C code with int16/int32 2012-06-25 01:51:46 +03:00
utils Remove unnecessary "head" arguments from some dlist/slist functions. 2012-10-18 19:04:20 -04:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
c.h Rename USE_INLINE to PG_USE_INLINE 2012-10-09 11:17:33 -03:00
fmgr.h
funcapi.h
getaddrinfo.h
getopt_long.h
Makefile Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
miscadmin.h Remove comment that is no longer true. 2012-10-15 11:03:39 +03:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
pg_config.h.in Rename USE_INLINE to PG_USE_INLINE 2012-10-09 11:17:33 -03:00
pg_config.h.win32 Rename USE_INLINE to PG_USE_INLINE 2012-10-09 11:17:33 -03:00
pg_trace.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
pgstat.h Unify calling conventions for postgres/postmaster sub-main functions 2012-06-25 21:30:12 +03:00
pgtime.h
port.h Make new event trigger facility actually do something. 2012-07-20 11:39:01 -04:00
postgres_ext.h Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
postgres_fe.h
postgres.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
rusagestub.h
windowapi.h