]> granicus.if.org Git - postgresql/commit
Redesign query-snapshot timing so that volatile functions in READ COMMITTED
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 13 Sep 2004 20:10:13 +0000 (20:10 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 13 Sep 2004 20:10:13 +0000 (20:10 +0000)
commitb2c4071299e02ed96d48d3c8e776de2fab36f88c
treeff0db14826870f1c3fe46d94ea3a1e1697c658a7
parentd69528881ab72eac5a9f154f23dbf549789c264d
Redesign query-snapshot timing so that volatile functions in READ COMMITTED
mode see a fresh snapshot for each command in the function, rather than
using the latest interactive command's snapshot.  Also, suppress fresh
snapshots as well as CommandCounterIncrement inside STABLE and IMMUTABLE
functions, instead using the snapshot taken for the most closely nested
regular query.  (This behavior is only sane for read-only functions, so
the patch also enforces that such functions contain only SELECT commands.)
As per my proposal of 6-Sep-2004; I note that I floated essentially the
same proposal on 19-Jun-2002, but that discussion tailed off without any
action.  Since 8.0 seems like the right place to be taking possibly
nontrivial backwards compatibility hits, let's get it done now.
41 files changed:
contrib/tablefunc/tablefunc.c
contrib/tsearch2/ts_stat.c
doc/src/sgml/plpython.sgml
doc/src/sgml/ref/create_function.sgml
doc/src/sgml/release.sgml
doc/src/sgml/spi.sgml
doc/src/sgml/xfunc.sgml
src/backend/access/transam/xact.c
src/backend/commands/cluster.c
src/backend/commands/copy.c
src/backend/commands/explain.c
src/backend/commands/indexcmds.c
src/backend/commands/portalcmds.c
src/backend/commands/prepare.c
src/backend/commands/vacuum.c
src/backend/executor/execMain.c
src/backend/executor/functions.c
src/backend/executor/spi.c
src/backend/tcop/fastpath.c
src/backend/tcop/postgres.c
src/backend/tcop/pquery.c
src/backend/tcop/utility.c
src/backend/utils/adt/ri_triggers.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/time/tqual.c
src/include/executor/execdesc.h
src/include/executor/executor.h
src/include/executor/spi.h
src/include/tcop/pquery.h
src/include/tcop/utility.h
src/include/utils/tqual.h
src/pl/plperl/plperl.c
src/pl/plperl/spi_internal.c
src/pl/plperl/spi_internal.h
src/pl/plpgsql/src/pl_comp.c
src/pl/plpgsql/src/pl_exec.c
src/pl/plpgsql/src/plpgsql.h
src/pl/plpython/plpython.c
src/pl/tcl/pltcl.c
src/test/regress/expected/transactions.out
src/test/regress/sql/transactions.sql