postgresql/contrib
Tom Lane 37507962c3 Handle unexpected query results, especially NULLs, safely in connectby().
connectby() didn't adequately check that the constructed SQL query returns
what it's expected to; in fact, since commit 08c33c426b it wasn't
checking that at all.  This could result in a null-pointer-dereference
crash if the constructed query returns only one column instead of the
expected two.  Less excitingly, it could also result in surprising data
conversion failures if the constructed query returned values that were
not I/O-conversion-compatible with the types specified by the query
calling connectby().

In all branches, insist that the query return at least two columns;
this seems like a minimal sanity check that can't break any reasonable
use-cases.

In HEAD, insist that the constructed query return the types specified by
the outer query, including checking for typmod incompatibility, which the
code never did even before it got broken.  This is to hide the fact that
the implementation does a conversion to text and back; someday we might
want to improve that.

In back branches, leave that alone, since adding a type check in a minor
release is more likely to break things than make people happy.  Type
inconsistencies will continue to work so long as the actual type and
declared type are I/O representation compatible, and otherwise will fail
the same way they used to.

Also, in all branches, be on guard for NULL results from the constructed
query, which formerly would cause null-pointer dereference crashes.
We now print the row with the NULL but don't recurse down from it.

In passing, get rid of the rather pointless idea that
build_tuplestore_recursively() should return the same tuplestore that's
passed to it.

Michael Paquier, adjusted somewhat by me
2015-01-29 20:18:33 -05:00
..
adminpack Update copyright for 2015 2015-01-06 11:43:47 -05:00
auth_delay Add file version information to most installed Windows binaries. 2014-07-14 14:07:52 -04:00
auto_explain Rearrange explain.c's API so callers need not embed sizeof(ExplainState). 2015-01-15 13:39:33 -05:00
btree_gin Turn much of the btree_gin macros into real functions. 2014-12-22 17:11:53 +02:00
btree_gist Remove dead NULL-pointer checks in GiST code. 2015-01-28 10:03:58 +02:00
chkpass Fix volatility markings of some contrib I/O functions. 2014-11-05 11:34:11 -05:00
citext Fix citext upgrade script for disallowance of oidvector element assignment. 2014-08-28 18:21:05 -04:00
cube Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
dblink Fix volatile-safety issue in dblink's materializeQueryResult(). 2015-01-26 15:17:33 -05:00
dict_int Update copyright for 2015 2015-01-06 11:43:47 -05:00
dict_xsyn Update copyright for 2015 2015-01-06 11:43:47 -05:00
earthdistance Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
file_fdw Update copyright for 2015 2015-01-06 11:43:47 -05:00
fuzzystrmatch Replace a bunch more uses of strncpy() with safer coding. 2015-01-24 13:05:42 -05:00
hstore Silence Coverity warnings about unused return values from pushJsonbValue() 2015-01-13 14:33:05 +02:00
intagg Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
intarray Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
isn Replace a bunch more uses of strncpy() with safer coding. 2015-01-24 13:05:42 -05:00
lo Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
ltree Fix volatility markings of some contrib I/O functions. 2014-11-05 11:34:11 -05:00
oid2name Add file version information to most installed Windows binaries. 2014-07-14 14:07:52 -04:00
pageinspect Update copyright for 2015 2015-01-06 11:43:47 -05:00
passwordcheck Update copyright for 2015 2015-01-06 11:43:47 -05:00
pg_archivecleanup Replace a few strncmp() calls with strlcpy(). 2014-08-18 22:59:31 -04:00
pg_buffercache Align buffer descriptors to cache line boundaries. 2015-01-29 22:48:45 +01:00
pg_freespacemap Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
pg_prewarm Update copyright for 2015 2015-01-06 11:43:47 -05:00
pg_standby pg_standby: Avoid writing one byte beyond the end of the buffer. 2015-01-15 09:26:03 -05:00
pg_stat_statements Prevent duplicate escape-string warnings when using pg_stat_statements. 2015-01-22 18:11:00 -05:00
pg_test_fsync Avoid file descriptor leak in pg_test_fsync. 2014-11-19 12:06:24 -05:00
pg_test_timing Correctly handle test durations of more than 2147s in pg_test_timing. 2015-01-04 15:44:49 +01:00
pg_trgm Replace a bunch more uses of strncpy() with safer coding. 2015-01-24 13:05:42 -05:00
pg_upgrade pg_upgrade: fix one-byte per empty db memory leak 2015-01-09 12:12:30 -05:00
pg_upgrade_support Update copyright for 2015 2015-01-06 11:43:47 -05:00
pg_xlogdump Update copyright for 2015 2015-01-06 11:43:47 -05:00
pgbench Replace a bunch more uses of strncpy() with safer coding. 2015-01-24 13:05:42 -05:00
pgcrypto Replace a bunch more uses of strncpy() with safer coding. 2015-01-24 13:05:42 -05:00
pgrowlocks Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
pgstattuple Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
postgres_fdw Update copyright for 2015 2015-01-06 11:43:47 -05:00
seg Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
sepgsql Update copyright for 2015 2015-01-06 11:43:47 -05:00
spi Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
sslinfo Make Port->ssl_in_use available, even when built with !USE_SSL 2014-11-25 09:46:11 +02:00
start-scripts doc: Reflect renaming of Mac OS X to OS X 2014-09-09 13:56:29 -04:00
tablefunc Handle unexpected query results, especially NULLs, safely in connectby(). 2015-01-29 20:18:33 -05:00
tcn Update copyright for 2015 2015-01-06 11:43:47 -05:00
test_decoding Update copyright for 2015 2015-01-06 11:43:47 -05:00
tsearch2 Update copyright for 2015 2015-01-06 11:43:47 -05:00
unaccent Update copyright for 2015 2015-01-06 11:43:47 -05:00
uuid-ossp Update copyright for 2015 2015-01-06 11:43:47 -05:00
vacuumlo vacuumlo: Avoid unlikely memory leak. 2015-01-14 15:14:20 -05:00
xml2 Replace a bunch more uses of strncpy() with safer coding. 2015-01-24 13:05:42 -05:00
Makefile Move test modules from contrib to src/test/modules 2014-11-29 23:55:00 -03:00
README Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00
contrib-global.mk Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00

README

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.

When building from the source distribution, these modules are not
built automatically, unless you build the "world" target.  You can
also build and install them all by running "make all" and "make
install" in this directory; or to build and install just one selected
module, do the same in that module's subdirectory.

Some directories supply new user-defined functions, operators, or
types.  To make use of one of these modules, after you have installed
the code you need to register the new SQL objects in the database
system by executing a CREATE EXTENSION command.  In a fresh database,
you can simply do

    CREATE EXTENSION module_name;

See the PostgreSQL documentation for more information about this
procedure.