pgsql: Extend the unknowns-are-same-as-known-inputs type resolution heu

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Extend the unknowns-are-same-as-known-inputs type resolution heu
Date: 2011-11-17 23:28:51
Message-ID: E1RRBNz-0006Q5-7D@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Extend the unknowns-are-same-as-known-inputs type resolution heuristic.

For a very long time, one of the parser's heuristics for resolving
ambiguous operator calls has been to assume that unknown-type literals are
of the same type as the other input (if it's known). However, this was
only used in the first step of quickly checking for an exact-types match,
and thus did not help in resolving matches that require coercion, such as
matches to polymorphic operators. As we add more polymorphic operators,
this becomes more of a problem. This patch adds another use of the same
heuristic as a last-ditch check before failing to resolve an ambiguous
operator or function call. In particular this will let us define the range
inclusion operator in a less limited way (to come in a follow-on patch).

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/1a8b9fb5499d8646661a57edd3c88c3107622ff8

Modified Files
--------------
doc/src/sgml/typeconv.sgml | 56 ++++++++++++++++---
src/backend/parser/parse_func.c | 117 +++++++++++++++++++++++++++++++++------
2 files changed, 147 insertions(+), 26 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-11-17 23:56:47 pgsql: Declare range inclusion operators as taking anyelement not anyno
Previous Message Tom Lane 2011-11-17 21:52:33 pgsql: Fix range_cmp_bounds for the case of equal-valued exclusive boun