postgresql/contrib
Tom Lane 0f359c7de9 Fix multiple bugs in contrib/pgstattuple's pgstatindex() function.
Dead or half-dead index leaf pages were incorrectly reported as live, as a
consequence of a code rearrangement I made (during a moment of severe brain
fade, evidently) in commit d287818eb5.

The index metapage was not counted in index_size, causing that result to
not agree with the actual index size on-disk.

Index root pages were not counted in internal_pages, which is inconsistent
compared to the case of a root that's also a leaf (one-page index), where
the root would be counted in leaf_pages.  Aside from that inconsistency,
this could lead to additional transient discrepancies between the reported
page counts and index_size, since it's possible for pgstatindex's scan to
see zero or multiple pages marked as BTP_ROOT, if the root moves due to
a split during the scan.  With these fixes, index_size will always be
exactly one page more than the sum of the displayed page counts.

Also, the index_size result was incorrectly documented as being measured in
pages; it's always been measured in bytes.  (While fixing that, I couldn't
resist doing some small additional wordsmithing on the pgstattuple docs.)

Including the metapage causes the reported index_size to not be zero for
an empty index.  To preserve the desired property that the pgstattuple
regression test results are platform-independent (ie, BLCKSZ configuration
independent), scale the index_size result in the regression tests.

The documentation issue was reported by Otsuka Kenji, and the inconsistent
root page counting by Peter Geoghegan; the other problems noted by me.
Back-patch to all supported branches, because this has been broken for
a long time.
2016-02-18 15:40:36 -05:00
..
adminpack Throw a useful error message if an extension script file is fed to psql. 2011-10-12 15:45:36 -04:00
auth_delay Limit values of archive_timeout, post_auth_delay, auth_delay.milliseconds. 2012-11-18 17:15:16 -05:00
auto_explain Fix auto-explain JSON output to be valid JSON. 2012-02-13 08:22:54 -05:00
btree_gin Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
btree_gist Fix misc typos. 2015-09-05 11:36:31 +03:00
chkpass Fix volatility markings of some contrib I/O functions. 2014-11-05 11:34:25 -05:00
citext Fix incorrect declaration of citext's regexp_matches() functions. 2015-05-05 15:50:53 -04:00
cube Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
dblink Lock down regression testing temporary clusters on Windows. 2014-12-17 22:48:47 -05:00
dict_int Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
dict_xsyn Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
dummy_seclabel pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
earthdistance Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
file_fdw Fix contrib/file_fdw's expected file 2015-03-06 11:47:09 -03:00
fuzzystrmatch Add missing va_end() call to a early exit in dmetaphone.c's StringAt(). 2015-01-04 15:35:47 +01:00
hstore Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
intagg Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
intarray Prevent stack overflow in query-type functions. 2015-10-05 10:06:35 -04:00
isn contrib/isn now needs a .gitignore file. 2015-08-02 23:58:00 -04:00
lo Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
ltree Prevent stack overflow in query-type functions. 2015-10-05 10:06:35 -04:00
oid2name Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
pageinspect Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
passwordcheck Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
pg_archivecleanup Remove tabs after spaces in C comments 2014-05-06 11:26:26 -04:00
pg_buffercache Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
pg_freespacemap Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
pg_standby pg_standby: Avoid writing one byte beyond the end of the buffer. 2015-01-15 09:42:33 -05:00
pg_stat_statements Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
pg_test_fsync Avoid file descriptor leak in pg_test_fsync. 2014-11-19 12:26:06 -05:00
pg_trgm Fix volatility markings of some contrib I/O functions. 2014-11-05 11:34:25 -05:00
pg_upgrade Fix spelling mistake. 2016-01-14 23:16:35 -05:00
pg_upgrade_support pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
pgbench pgbench: avoid FD_ISSET on an invalid file descriptor 2016-02-15 20:33:43 -03:00
pgcrypto Add forgotten CHECK_FOR_INTERRUPT calls in pgcrypto's crypt() 2015-12-27 13:03:19 -03:00
pgrowlocks Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
pgstattuple Fix multiple bugs in contrib/pgstattuple's pgstatindex() function. 2016-02-18 15:40:36 -05:00
seg Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
sepgsql Fix typo in comment. 2014-04-01 09:29:44 +03:00
spi Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
sslinfo Fix error message wording in previous sslinfo commit 2015-09-08 11:10:20 -03:00
start-scripts Fix overly-aggressive and inconsistent quoting in OS X start script. 2011-11-26 13:01:22 -05:00
tablefunc Handle unexpected query results, especially NULLs, safely in connectby(). 2015-01-29 20:18:44 -05:00
test_parser Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
tsearch2 Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
unaccent Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
uuid-ossp Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:53 +02:00
vacuumlo Back-patch contrib/vacuumlo's new -l (limit) option into 9.0 and 9.1. 2012-03-21 13:04:55 -04:00
xml2 Free libxml2/libxslt resources in a safer order. 2014-11-27 11:12:59 -05:00
contrib-global.mk Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Makefile Make distprep and *clean build targets recurse into all subdirectories. 2011-07-03 13:55:27 -04:00
README Recode non-ASCII characters in source to UTF-8 2011-05-31 23:11:46 +03: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>

file_fdw
	Foreign-data wrapper for server-side CSV/TEXT files
	by Shigeru Hanada <hanada@metrosystems.co.jp>

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á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_test_fsync -
	Test different wal_sync_method settings
	by Bruce Momjian <bruce@momjian.us>

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>

sepgsql -
	External security provider using SELinux
	by KaiGai Kohei <kaigai@ak.jp.nec.com>

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>