More code review for rangetypes patch.

Fix up some infelicitous coding in DefineRange, and add some missing error
checks.  Rearrange operator strategy number assignments for GiST anyrange
opclass so that they don't make such a mess of opr_sanity's table of
operator names associated with different strategy numbers.  Assign
hopefully-temporary selectivity estimators to range operators that didn't
have one --- poor as the estimates are, they're still a lot better than the
default 0.5 estimate, and they'll shut up the opr_sanity test that wants to
see selectivity estimators on all built-in operators.
This commit is contained in:
Tom Lane
2011-11-21 16:19:53 -05:00
parent 9b97b7f835
commit a4ffcc8e11
11 changed files with 548 additions and 523 deletions

View File

@ -3600,13 +3600,3 @@ select testoa(1,2,1); -- fail at update
drop function arrayassign1();
drop function testoa(x1 int, x2 int, x3 int);
-- Test resolve_polymorphic_argtypes() codepath. It is only taken when
-- a function is invoked from a different backend from where it's defined,
-- so we create the a function with polymorphic argument, reconnect, and
-- and then call it.
create function rangetypes_plpgsql(out a anyelement, b anyrange, c anyarray)
language plpgsql as
$$ begin a := upper(b) + c[1]; return; end; $$;
\c -
select rangetypes_plpgsql(int4range(1,10),ARRAY[2,20]);