Fix an oversight in my patch of a couple weeks ago that ensured a snapshot
authorTom Lane <[email protected]>
Thu, 1 Jan 2009 17:12:16 +0000 (17:12 +0000)
committerTom Lane <[email protected]>
Thu, 1 Jan 2009 17:12:16 +0000 (17:12 +0000)
commitfcf61977ce94a19318bebe291000b73683abe21e
tree7ee391f0c972fe6241e9d5d237222a20760800dc
parent431092f5a04e0756ed43339945e9786713791074
Fix an oversight in my patch of a couple weeks ago that ensured a snapshot
is available during datatype input in Bind message processing.  I put the
PopActiveSnapshot() or equivalent just before PortalDefineQuery, which is
an unsafe spot for it (in 8.3 and later) because we are carrying a plancache
refcount that hasn't yet been assigned to the portal.  Any error thrown there
would result in leaking the refcount.  It's not exactly likely that
PopActiveSnapshot would throw an elog, perhaps, but it could happen.
Reorder the code and add another comment warning not to do that.
src/backend/tcop/postgres.c