postgresql/contrib
Tom Lane 73912e7fbd Fix GIN to support null keys, empty and null items, and full index scans.
Per my recent proposal(s).  Null key datums can now be returned by
extractValue and extractQuery functions, and will be stored in the index.
Also, placeholder entries are made for indexable items that are NULL or
contain no keys according to extractValue.  This means that the index is
now always complete, having at least one entry for every indexed heap TID,
and so we can get rid of the prohibition on full-index scans.  A full-index
scan is implemented much the same way as partial-match scans were already:
we build a bitmap representing all the TIDs found in the index, and then
drive the results off that.

Also, introduce a concept of a "search mode" that can be requested by
extractQuery when the operator requires matching to empty items (this is
just as cheap as matching to a single key) or requires a full index scan
(which is not so cheap, but it sure beats failing or giving wrong answers).
The behavior remains backward compatible for opclasses that don't return
any null keys or request a non-default search mode.

Using these features, we can now make the GIN index opclass for anyarray
behave in a way that matches the actual anyarray operators for &&, <@, @>,
and = ... which it failed to do before in assorted corner cases.

This commit fixes the core GIN code and ginarrayprocs.c, updates the
documentation, and adds some simple regression test cases for the new
behaviors using the array operators.  The tsearch and contrib GIN opclass
support functions still need to be looked over and probably fixed.

Another thing I intend to fix separately is that this is pretty inefficient
for cases where more than one scan condition needs a full-index search:
we'll run duplicate GinScanEntrys, each one of which builds a large bitmap.
There is some existing logic to merge duplicate GinScanEntrys but it needs
refactoring to make it work for entries belonging to different scan keys.

Note that most of gin.h has been split out into a new file gin_private.h,
so that gin.h doesn't export anything that's not supposed to be used by GIN
opclasses or the rest of the backend.  I did quite a bit of other code
beautification work as well, mostly fixing comments and choosing more
appropriate names for things.
2011-01-07 19:16:24 -05:00
..
adminpack Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
auth_delay New contrib module, auth_delay. 2010-11-27 07:22:25 -05:00
auto_explain Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
btree_gin Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
btree_gist Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
chkpass Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
citext Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
cube Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
dblink Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
dict_int Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
dict_xsyn Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
dummy_seclabel Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
earthdistance Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
fuzzystrmatch Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
hstore Fix GIN to support null keys, empty and null items, and full index scans. 2011-01-07 19:16:24 -05:00
intagg Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
intarray Fix erroneous parsing of tsquery input "... & !(subexpression) | ..." 2010-12-19 12:48:34 -05:00
isn Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
lo Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
ltree Use memcmp() rather than strncmp() when shorter string length is known. 2010-12-21 22:11:40 -05:00
oid2name Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
pageinspect Basic foreign table support. 2011-01-01 23:48:11 -05:00
passwordcheck Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
pg_archivecleanup Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
pg_buffercache Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
pg_freespacemap Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
pg_standby Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
pg_stat_statements Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
pg_trgm Add KNNGIST support to contrib/pg_trgm. 2010-12-04 00:16:21 -05:00
pg_upgrade Improve C comments about backend variables set by pg_upgrade_support 2011-01-06 22:45:36 -05:00
pg_upgrade_support Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
pgbench Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
pgcrypto Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
pgrowlocks Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
pgstattuple Basic foreign table support. 2011-01-01 23:48:11 -05:00
seg Fix contrib/seg's GiST picksplit method. 2010-12-15 21:24:47 -05:00
spi Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
sslinfo Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
start-scripts Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
tablefunc Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
test_parser Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
tsearch2 Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
unaccent Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
uuid-ossp Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
vacuumlo Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
xml2 Fix significant memory leak in contrib/xml2 functions. 2010-11-26 15:21:53 -05:00
contrib-global.mk Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Makefile New contrib module, auth_delay. 2010-11-27 07:22:25 -05:00
README Fix typo. 2010-11-28 20:46:11 -05:00

The PostgreSQL contrib tree
---------------------------

This subtree contains porting tools, analysis utilities, and plug-in
features that are not part of the core PostgreSQL system, mainly because
they address a limited audience or are too experimental to be part of
the main source tree.  This does not preclude their usefulness.

User documentation for each module appears in the main SGML documentation.

Most items can be built with `gmake all' and installed with
`gmake install' in the usual fashion, after you have run the `configure'
script in the top-level directory.  Some directories supply new
user-defined functions, operators, or types.  In these cases, after you have
installed the files you need to register the new entities in the database
system by running the commands in the supplied .sql file.  For example,

	$ psql -d dbname -f module.sql

See the PostgreSQL documentation for more information about this
procedure.


Index:
------

adminpack -
	File and log manipulation routines, used by pgAdmin
	by Dave Page <dpage@vale-housing.co.uk>

auth_delay
	Add a short delay after a failed authentication attempt, to make
    brute-force attacks on database passwords a bit harder.
	by KaiGai Kohei <kaigai@ak.jp.nec.com>

auto_explain -
	Log EXPLAIN output for long-running queries
	by Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>

btree_gin -
	Support for emulating BTREE indexing in GIN
	by Oleg Bartunov <oleg@sai.msu.su> and Teodor Sigaev <teodor@sigaev.ru>

btree_gist -
	Support for emulating BTREE indexing in GiST
	by Oleg Bartunov <oleg@sai.msu.su> and Teodor Sigaev <teodor@sigaev.ru>

chkpass -
	An auto-encrypted password datatype
	by D'Arcy J.M. Cain <darcy@druid.net>

citext -
	A case-insensitive character string datatype
	by David E. Wheeler <david@kineticode.com>

cube -
	Multidimensional-cube datatype (GiST indexing example)
	by Gene Selkov, Jr. <selkovjr@mcs.anl.gov>

dblink -
	Allows remote query execution
	by Joe Conway <mail@joeconway.com>

dict_int -
	Text search dictionary template for integers
	by Sergey Karpov <karpov@sao.ru>

dict_xsyn -
	Text search dictionary template for extended synonym processing
	by Sergey Karpov <karpov@sao.ru>

earthdistance -
	Functions for computing distances between two points on Earth
        by Bruno Wolff III <bruno@wolff.to> and Hal Snyder <hal@vailsys.com>

fuzzystrmatch -
	Levenshtein, metaphone, and soundex fuzzy string matching
	by Joe Conway <mail@joeconway.com> and Joel Burton <jburton@scw.org>

hstore -
	Module for storing (key, value) pairs
	by Oleg Bartunov <oleg@sai.msu.su> and Teodor Sigaev <teodor@sigaev.ru>

intagg -
	Integer aggregator
	by mlw <markw@mohawksoft.com>

intarray -
	Index support for arrays of int4, using GiST
	by Teodor Sigaev <teodor@sigaev.ru> and Oleg Bartunov <oleg@sai.msu.su>

isn -
	PostgreSQL type extensions for ISBN, ISSN, ISMN, EAN13 product numbers
	by Germ<72>n M<>ndez Bravo (Kronuz) <kronuz@hotmail.com>

lo -
	Large Object maintenance
	by Peter Mount <peter@retep.org.uk>

ltree -
	Tree-like data structures
	by Teodor Sigaev <teodor@sigaev.ru> and Oleg Bartunov <oleg@sai.msu.su>

oid2name -
	Maps numeric files to table names
	by B Palmer <bpalmer@crimelabs.net>

pageinspect -
	Allows inspection of database pages
	Heikki Linnakangas <heikki@enterprisedb.com>

passwordcheck -
	Simple password strength checker
	Laurenz Albe <laurenz.albe@wien.gv.at>

pg_buffercache -
	Real time queries on the shared buffer cache
	by Mark Kirkwood <markir@paradise.net.nz>

pg_freespacemap -
	Displays the contents of the free space map (FSM)
	by Mark Kirkwood <markir@paradise.net.nz>

pg_standby -
	Sample archive_command for warm standby operation
	by Simon Riggs <simon@2ndquadrant.com>

pg_stat_statements -
	Track statement execution times across a whole database cluster
	by Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>

pg_trgm -
	Functions for determining the similarity of text based on trigram
	matching.
	by Oleg Bartunov <oleg@sai.msu.su> and Teodor Sigaev <teodor@sigaev.ru>

pg_upgrade -
	Support for in-place upgrade between major releases of PostgreSQL
	Bruce Momjian <bruce@momjian.us> and others

pgbench -
	TPC-B like benchmarking tool
	by Tatsuo Ishii <ishii@sraoss.co.jp>

pgcrypto -
	Cryptographic functions
	by Marko Kreen <marko@l-t.ee>

pgrowlocks -
	A function to return row locking information
	by Tatsuo Ishii <ishii@sraoss.co.jp>

pgstattuple -
	Functions to return statistics about "dead" tuples and free
	space within a table
	by Tatsuo Ishii <ishii@sraoss.co.jp>

seg -
	Confidence-interval datatype (GiST indexing example)
	by Gene Selkov, Jr. <selkovjr@mcs.anl.gov>

spi -
	Various trigger functions, examples for using SPI.

sslinfo -
	Functions to get information about SSL certificates
	by Victor Wagner <vitus@cryptocom.ru>

start-scripts -
	Scripts for starting the server at boot time on various platforms.

tablefunc -
	Examples of functions returning tables
	by Joe Conway <mail@joeconway.com>

test_parser -
	Sample text search parser
	by Sergey Karpov <karpov@sao.ru>

tsearch2 -
	Compatibility package for the pre-8.3 implementation of text search.
	Pavel Stehule <pavel.stehule@gmail.com>, based on code originally by
	Teodor Sigaev <teodor@sigaev.ru> and Oleg Bartunov <oleg@sai.msu.su>.

unaccent -
	Unaccent dictionary for text search
	Teodor Sigaev <teodor@sigaev.ru> and Oleg Bartunov <oleg@sai.msu.su>.

uuid-ossp -
	UUID generation functions
	by Peter Eisentraut <peter_e@gmx.net>

vacuumlo -
	Remove orphaned large objects
	by Peter T Mount <peter@retep.org.uk>

xml2 -
	Storing XML in PostgreSQL
	by John Gray <jgray@azuli.co.uk>