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

Doubt about boundParams

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Doubt about boundParams
Date: 2011-08-02 09:54:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Hi All,
I am looking at usage of bound parameters.

In functions SPI_cursor_open_with_args() and SPI_cursor_open_with_args()
parameters are flagged as constants and passed to the planner in following
paramLI = _SPI_convert_params(nargs, argtypes,
                                   Values, Nulls,

 _SPI_prepare_plan(src, &plan, paramLI);

The bound params "paramLI" are then passed to the planner as boundParams.
Before actually planning the query, these parameters are evaluated duing
constant evaluation (eval_const_expressions_mutator()), and the Param nodes
are replaced with Constant nodes.
Further, while executing such queries we pass the paramLI structure to the
execution routine e.g. _SPI_execute_plan(). These parameter values are
stored in "EState" structure. But, since these parameters are already folded
into queries, it looks like parameter values stored in EState are never

Is this correct? Or somewhere we use those parameter values?

Best Wishes,
Ashutosh Bapat
EntepriseDB Corporation
The Enterprise Postgres Company


pgsql-hackers by date

Next:From: Heikki LinnakangasDate: 2011-08-02 10:15:48
Subject: Re: Doubt about boundParams
Previous:From: Florian PflugDate: 2011-08-02 08:33:39
Subject: Re: WIP fix proposal for bug #6123

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