postgresql/src
Peter Eisentraut 2657d4ea66 Fix snapshot leak warning for some procedures
The problem arises with the combination of CALL with output parameters
and doing a COMMIT inside the procedure.  When a CALL has output
parameters, the portal uses the strategy PORTAL_UTIL_SELECT instead of
PORTAL_MULTI_QUERY.  Using PORTAL_UTIL_SELECT causes the portal's
snapshot to be registered with the current resource
owner (portal->holdSnapshot); see
9ee1cf04ab for the reason.

Normally, PortalDrop() unregisters the snapshot.  If not, then
ResourceOwnerRelease() will print a warning about a snapshot leak on
transaction commit.  A transaction commit normally drops all
portals (PreCommit_Portals()), except the active portal.  So in case of
the active portal, we need to manually release the snapshot to avoid the
warning.

Reported-by: Prabhat Sahu <prabhat.sahu@enterprisedb.com>
Reviewed-by: Jonathan S. Katz <jkatz@postgresql.org>
2018-08-27 22:15:39 +02:00
..
backend Fix snapshot leak warning for some procedures 2018-08-27 22:15:39 +02:00
bin Fix missing dependency for pg_dump's ENABLE ROW LEVEL SECURITY items. 2018-08-27 15:11:12 -04:00
common Clean up assorted misuses of snprintf()'s result value. 2018-08-15 16:29:32 -04:00
fe_utils Fix lexing of standard multi-character operators in edge cases. 2018-08-23 21:43:51 +01:00
include LLVMJIT: LLVMGetHostCPUFeatures now is upstream, use LLMV version if available. 2018-08-24 10:21:48 -07:00
interfaces Fix lexing of standard multi-character operators in edge cases. 2018-08-23 21:43:51 +01:00
makefiles Provide for contrib and pgxs modules to install include files. 2018-07-31 19:58:39 +01:00
pl Fix snapshot leak warning for some procedures 2018-08-27 22:15:39 +02:00
port Make snprintf.c follow the C99 standard for snprintf's result value. 2018-08-15 17:25:49 -04:00
template Force "restrict" not to be used when compiling with xlc. 2017-10-13 12:15:06 -07:00
test Fix lexing of standard multi-character operators in edge cases. 2018-08-23 21:43:51 +01:00
timezone Update time zone data files to tzdata release 2018e. 2018-05-09 13:56:22 -04:00
tools MSVC: Finish clean.bat tmp_check coverage. 2018-08-19 01:12:25 -07:00
tutorial Update copyright for 2018 2018-01-02 23:30:12 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Ensure we build generated headers at the start of some more cases. 2018-07-30 18:04:39 -04:00
Makefile.shlib Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-04-03 16:26:05 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00