Skip site navigation (1) Skip section navigation (2)

pgsql: Fix up plpgsql's "simple expression" evaluation mechanism so that

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix up plpgsql's "simple expression" evaluation mechanism so that
Date: 2007-01-28 16:15:50
Message-ID: 20070128161550.2A1D59FB1D7@postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Fix up plpgsql's "simple expression" evaluation mechanism so that it behaves
safely in the presence of subtransactions.  To ensure that any ExprContext
shutdown callbacks are called at the right times, we have to have a separate
EState for each level of subtransaction.  Per "TupleDesc reference leak" bug
report from Stefan Kaltenbrunner.

Although I'm convinced the code is wrong as far back as 8.0, it doesn't seem
that there are any ways for the problem to really manifest before 8.2: AFAICS,
8.0 and 8.1 only use the ExprContextCallback mechanism to handle set-returning
functions, which cannot usefully be executed in a "simple expression" anyway.
Hence, no backpatch before 8.2 --- the risk of unforeseen breakage seems
to outweigh the chance of fixing something.

Modified Files:
--------------
    pgsql/src/pl/plpgsql/src:
        pl_exec.c (r1.183 -> r1.184)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_exec.c.diff?r1=1.183&r2=1.184)
        pl_handler.c (r1.34 -> r1.35)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_handler.c.diff?r1=1.34&r2=1.35)
        plpgsql.h (r1.82 -> r1.83)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/plpgsql.h.diff?r1=1.82&r2=1.83)

pgsql-committers by date

Next:From: Tom LaneDate: 2007-01-28 16:15:58
Subject: pgsql: Fix up plpgsql's "simple expression" evaluation mechanism so that
Previous:From: Bruce MomjianDate: 2007-01-28 14:07:41
Subject: Re: pgsql: Drat, can't fit an additional

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group