postgresql/contrib
Tom Lane 76f965ff1f Improve handling of collations in contrib/postgres_fdw.
If we have a local Var of say varchar type with default collation, and
we apply a RelabelType to convert that to text with default collation, we
don't want to consider that as creating an FDW_COLLATE_UNSAFE situation.
It should be okay to compare that to a remote Var, so long as the remote
Var determines the comparison collation.  (When we actually ship such an
expression to the remote side, the local Var would become a Param with
default collation, meaning the remote Var would in fact control the
comparison collation, because non-default implicit collation overrides
default implicit collation in parse_collate.c.)  To fix, be more precise
about what FDW_COLLATE_NONE means: it applies either to a noncollatable
data type or to a collatable type with default collation, if that collation
can't be traced to a remote Var.  (When it can, FDW_COLLATE_SAFE is
appropriate.)  We were essentially using that interpretation already at
the Var/Const/Param level, but we weren't bubbling it up properly.

An alternative fix would be to introduce a separate FDW_COLLATE_DEFAULT
value to describe the second situation, but that would add more code
without changing the actual behavior, so it didn't seem worthwhile.

Also, since we're clarifying the rule to be that we care about whether
operator/function input collations match, there seems no need to fail
immediately upon seeing a Const/Param/non-foreign-Var with nondefault
collation.  We only have to reject if it appears in a collation-sensitive
context (for example, "var IS NOT NULL" is perfectly safe from a collation
standpoint, whatever collation the var has).  So just set the state to
UNSAFE rather than failing immediately.

Per report from Jeevan Chalke.  This essentially corrects some sloppy
thinking in commit ed3ddf918b, so back-patch
to 9.3 where that logic appeared.
2015-09-24 12:47:29 -04:00
..
adminpack
auth_delay
auto_explain
btree_gin
btree_gist Fix misc typos. 2015-09-05 11:35:49 +03:00
chkpass
citext
cube Fix misc typos. 2015-09-05 11:35:49 +03:00
dblink Rearrange the handling of error context reports. 2015-09-05 11:58:33 -04:00
dict_int
dict_xsyn
earthdistance
file_fdw
fuzzystrmatch
hstore
hstore_plperl Rearrange the handling of error context reports. 2015-09-05 11:58:33 -04:00
hstore_plpython Rearrange the handling of error context reports. 2015-09-05 11:58:33 -04:00
intagg
intarray Add selectivity estimation functions for intarray operators. 2015-07-21 20:59:24 +03:00
isn contrib/isn now needs a .gitignore file. 2015-08-02 23:57:32 -04:00
lo
ltree
ltree_plpython Rearrange the handling of error context reports. 2015-09-05 11:58:33 -04:00
oid2name
pageinspect Use materialize SRF mode in brin_page_items 2015-08-13 13:02:10 -03:00
passwordcheck
pg_buffercache
pg_freespacemap
pg_prewarm
pg_standby Don't use function definitions looking like old-style ones. 2015-08-15 17:25:00 +02:00
pg_stat_statements Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
pg_trgm This supports the triconsistent function for pg_trgm GIN opclass 2015-07-20 18:18:48 +03:00
pgcrypto
pgrowlocks
pgstattuple Prevent pgstattuple() from reporting BRIN as unknown index. 2015-07-14 22:36:51 +09:00
postgres_fdw Improve handling of collations in contrib/postgres_fdw. 2015-09-24 12:47:29 -04:00
seg
sepgsql Adjust sepgsql regression output for recent error context change 2015-09-06 11:25:36 -07:00
spi
sslinfo Fix error message wording in previous sslinfo commit 2015-09-08 11:10:20 -03:00
start-scripts
tablefunc Fix a number of places that produced XX000 errors in the regression tests. 2015-08-02 23:49:19 -04:00
tcn
test_decoding test_decoding: Protect against rare spurious test failures. 2015-09-22 15:39:46 +02:00
tsearch2 Add an optional missing_ok argument to SQL function current_setting(). 2015-07-02 16:41:07 -04:00
tsm_system_rows Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
tsm_system_time Some platforms now need contrib/tsm_system_time to be linked with libm. 2015-07-25 16:37:12 -04:00
unaccent Make unaccent handle all diacritics known to Unicode, and expand ligatures correctly 2015-09-04 12:51:53 +03:00
uuid-ossp
vacuumlo
xml2
contrib-global.mk
Makefile
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.