]> granicus.if.org Git - postgresql/commit
Fix failure to ensure that a snapshot is available to datatype input functions
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 13 Dec 2008 02:00:30 +0000 (02:00 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 13 Dec 2008 02:00:30 +0000 (02:00 +0000)
commit8d1d6019d4d85c51a4c414bb95a71f8897956218
tree53c49d58547742a24d2487b85d224a8aa1063f21
parentf6bab284885a4594cfa8f199ba7458dca81059f3
Fix failure to ensure that a snapshot is available to datatype input functions
when they are invoked by the parser.  We had been setting up a snapshot at
plan time but really it needs to be done earlier, before parse analysis.
Per report from Dmitry Koterov.

Also fix two related problems discovered while poking at this one:
exec_bind_message called datatype input functions without establishing a
snapshot, and SET CONSTRAINTS IMMEDIATE could call trigger functions without
establishing a snapshot.

Backpatch to 8.2.  The underlying problem goes much further back, but it is
masked in 8.1 and before because we didn't attempt to invoke domain check
constraints within datatype input.  It would only be exposed if a C-language
datatype input function used the snapshot; which evidently none do, or we'd
have heard complaints sooner.  Since this code has changed a lot over time,
a back-patch is hardly risk-free, and so I'm disinclined to patch further
than absolutely necessary.
src/backend/commands/trigger.c
src/backend/parser/analyze.c
src/backend/tcop/postgres.c
src/backend/utils/cache/plancache.c
src/include/parser/analyze.h