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

pgsql: Fix get_name_for_var_field() to deal with RECORD Params.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix get_name_for_var_field() to deal with RECORD Params.
Date: 2011-09-07 17:02:52
Message-ID: E1R1LWW-0004dB-Hi@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Fix get_name_for_var_field() to deal with RECORD Params.

With 9.1's use of Params to pass down values from NestLoop join nodes
to their inner plans, it is possible for a Param to have type RECORD, in
which case the set of fields comprising the value isn't determinable by
inspection of the Param alone.  However, just as with a Var of type RECORD,
we can find out what we need to know if we can locate the expression that
the Param represents.  We already knew how to do this in get_parameter(),
but I'd overlooked the need to be able to cope in get_name_for_var_field(),
which led to EXPLAIN failing with "record type has not been registered".

To fix, refactor the search code in get_parameter() so it can be used by
both functions.

Per report from Marti Raudsepp.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a7d9203cc4edfbcc283732efea6d54db0399ccee

Modified Files
--------------
src/backend/utils/adt/ruleutils.c |  171 +++++++++++++++++++++++++------------
1 files changed, 115 insertions(+), 56 deletions(-)

pgsql-committers by date

Next:From: Tom LaneDate: 2011-09-07 17:29:48
Subject: pgsql: Fix typo in error message.
Previous:From: Bruce MomjianDate: 2011-09-07 16:59:53
Subject: pgsql: Have pgrminclude skip files that use CppAsString2 becauseCppAsS

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