postgresql/contrib/pg_trgm
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 trgm - Trigram matching for PostgreSQL 2004-05-31 17:18:12 +00:00
expected Make contrib/pg_trgm also support regex searches with GiST indexes. 2013-04-10 13:31:02 -04:00
sql Make contrib/pg_trgm also support regex searches with GiST indexes. 2013-04-10 13:31:02 -04:00
.gitignore Support "make check" in contrib 2011-04-25 22:27:11 +03:00
Makefile This supports the triconsistent function for pg_trgm GIN opclass 2015-07-20 18:18:48 +03:00
pg_trgm--1.0--1.1.sql Fix typo in update scripts for some contrib modules. 2013-07-19 04:13:01 +09:00
pg_trgm--1.1--1.2.sql This supports the triconsistent function for pg_trgm GIN opclass 2015-07-20 18:18:48 +03:00
pg_trgm--1.2.sql Fix assorted inconsistencies in GiST opclass support function declarations. 2016-01-19 12:04:36 -05:00
pg_trgm--unpackaged--1.0.sql Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
pg_trgm.control This supports the triconsistent function for pg_trgm GIN opclass 2015-07-20 18:18:48 +03:00
trgm_gin.c Improve the gin index scan performance in pg_trgm. 2015-12-25 13:05:13 +03:00
trgm_gist.c Move strategy numbers to include/access/stratnum.h 2015-05-15 17:03:16 -03:00
trgm_op.c Reorganize our CRC source files again. 2015-04-14 17:03:42 +03:00
trgm_regexp.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
trgm.h Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. 2015-02-20 00:11:42 -05:00