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

pgsql: Insert conditional SPI_push/SPI_pop calls into InputFunctionCall,

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Insert conditional SPI_push/SPI_pop calls into InputFunctionCall,
Date: 2009-01-07 20:39:05
Message-ID: 20090107203905.788B4754A1B@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Insert conditional SPI_push/SPI_pop calls into InputFunctionCall,
OutputFunctionCall, and friends.  This allows SPI-using functions to invoke
datatype I/O without concern for the possibility that a SPI-using function
will be called (which could be either the I/O function itself, or a function
used in a domain check constraint).  It's a tad ugly, but not nearly as ugly
as what'd be needed to make this work via retail insertion of push/pop
operations in all the PLs.

This reverts my patch of 2007-01-30 that inserted some retail SPI_push/pop
calls into plpgsql; that approach only fixed plpgsql, and not any other PLs.
But the other PLs have the issue too, as illustrated by a recent gripe from
Christian Schrder.

Back-patch to 8.2, which is as far back as this solution will work.  It's
also as far back as we need to worry about the domain-constraint case, since
earlier versions did not attempt to check domain constraints within datatype
input.  I'm not aware of any old I/O functions that use SPI themselves, so
this should be sufficient for a back-patch.

Tags:
----
REL8_3_STABLE

Modified Files:
--------------
    pgsql/src/backend/executor:
        spi.c (r1.188.2.3 -> r1.188.2.4)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/spi.c?r1=1.188.2.3&r2=1.188.2.4)
    pgsql/src/backend/utils/fmgr:
        fmgr.c (r1.113 -> r1.113.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/fmgr/fmgr.c?r1=1.113&r2=1.113.2.1)
    pgsql/src/include/executor:
        spi.h (r1.65.2.1 -> r1.65.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/spi.h?r1=1.65.2.1&r2=1.65.2.2)
    pgsql/src/pl/plpgsql/src:
        pl_exec.c (r1.202.2.1 -> r1.202.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_exec.c?r1=1.202.2.1&r2=1.202.2.2)

pgsql-committers by date

Next:From: Tom LaneDate: 2009-01-07 20:39:15
Subject: pgsql: Insert conditional SPI_push/SPI_pop calls into InputFunctionCall,
Previous:From: Tom LaneDate: 2009-01-07 20:38:56
Subject: pgsql: Insert conditional SPI_push/SPI_pop calls into InputFunctionCall,

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