postgresql/contrib/cube
Tom Lane 9ff60273e3 Fix assorted inconsistencies in GiST opclass support function declarations.
The conventions specified by the GiST SGML documentation were widely
ignored.  For example, the strategy-number argument for "consistent" and
"distance" functions is specified to be a smallint, but most of the
built-in support functions declared it as an integer, and for that matter
the core code passed it using Int32GetDatum not Int16GetDatum.  None of
that makes any real difference at runtime, but it's quite confusing for
newcomers to the code, and it makes it very hard to write an amvalidate()
function that checks support function signatures.  So let's try to instill
some consistency here.

Another similar issue is that the "query" argument is not of a single
well-defined type, but could have different types depending on the strategy
(corresponding to search operators with different righthand-side argument
types).  Some of the functions threw up their hands and declared the query
argument as being of "internal" type, which surely isn't right ("any" would
have been more appropriate); but the majority position seemed to be to
declare it as being of the indexed data type, corresponding to a search
operator with both input types the same.  So I've specified a convention
that that's what to do always.

Also, the result of the "union" support function actually must be of the
index's storage type, but the documentation suggested declaring it to
return "internal", and some of the functions followed that.  Standardize
on telling the truth, instead.

Similarly, standardize on declaring the "same" function's inputs as
being of the storage type, not "internal".

Also, somebody had forgotten to add the "recheck" argument to both
the documentation of the "distance" support function and all of their
SQL declarations, even though the C code was happily using that argument.
Clean that up too.

Fix up some other omissions in the docs too, such as documenting that
union's second input argument is vestigial.

So far as the errors in core function declarations go, we can just fix
pg_proc.h and bump catversion.  Adjusting the erroneous declarations in
contrib modules is more debatable: in principle any change in those
scripts should involve an extension version bump, which is a pain.
However, since these changes are purely cosmetic and make no functional
difference, I think we can get away without doing that.
2016-01-19 12:04:36 -05:00
..
data
expected Code and docs review for cube kNN support. 2015-12-28 14:39:12 -05:00
sql Cube extension kNN support 2015-12-18 14:38:27 +03:00
.gitignore
CHANGES
cube--1.0--1.1.sql Fix whitespace 2015-12-19 11:46:38 -05:00
cube--1.1.sql Fix assorted inconsistencies in GiST opclass support function declarations. 2016-01-19 12:04:36 -05:00
cube--unpackaged--1.0.sql
cube.c Code and docs review for cube kNN support. 2015-12-28 14:39:12 -05:00
cube.control Cube extension kNN support 2015-12-18 14:38:27 +03:00
cubedata.h Cube extension kNN support 2015-12-18 14:38:27 +03:00
cubeparse.y
cubescan.l
Makefile Cube extension kNN support 2015-12-18 14:38:27 +03:00