postgresql/src/backend/utils/adt
Tom Lane 26e66184d6 Fix assorted missing infrastructure for ON CONFLICT.
subquery_planner() failed to apply expression preprocessing to the
arbiterElems and arbiterWhere fields of an OnConflictExpr.  No doubt the
theory was that this wasn't necessary because we don't actually try to
execute those expressions; but that's wrong, because it results in failure
to match to index expressions or index predicates that are changed at all
by preprocessing.  Per bug #14132 from Reynold Smith.

Also add pullup_replace_vars processing for onConflictWhere.  Perhaps
it's impossible to have a subquery reference there, but I'm not exactly
convinced; and even if true today it's a failure waiting to happen.

Also add some comments to other places where one or another field of
OnConflictExpr is intentionally ignored, with explanation as to why it's
okay to do so.

Also, catalog/dependency.c failed to record any dependency on the named
constraint in ON CONFLICT ON CONSTRAINT, allowing such a constraint to
be dropped while rules exist that depend on it, and allowing pg_dump to
dump such a rule before the constraint it refers to.  The normal execution
path managed to error out reasonably for a dangling constraint reference,
but ruleutils.c dumped core; so in addition to fixing the omission, add
a protective check in ruleutils.c, since we can't retroactively add a
dependency in existing databases.

Back-patch to 9.5 where this code was introduced.

Report: <20160510190350.2608.48667@wrigleys.postgresql.org>
2016-05-11 16:20:23 -04:00
..
Makefile Introduce SP-GiST operator class over box. 2016-03-30 18:42:36 +03:00
acl.c Reserve the "pg_" namespace for roles 2016-04-08 16:56:27 -04:00
array_expanded.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
array_selfuncs.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
array_typanalyze.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
array_userfuncs.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
arrayfuncs.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
arrayutils.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
ascii.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
bool.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
cash.c Collection of typo fixes. 2015-05-20 16:56:22 +03:00
char.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
date.c Be more careful about out-of-range dates and timestamps. 2016-03-16 19:09:28 -04:00
datetime.c Rename strtoi() to strtoint(). 2016-04-23 16:53:15 -04:00
datum.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
dbsize.c Tweak a few more things in preparation for upcoming pgindent run. 2016-05-03 10:52:25 -04:00
domains.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
encode.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
enum.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
expandeddatum.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
float.c Yet more portability hacking for degree-based trig functions. 2016-04-26 11:24:15 -04:00
format_type.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
formatting.c Fix possible read past end of string in to_timestamp(). 2016-05-06 12:09:20 -04:00
genfile.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
geo_ops.c Improve portability of I/O behavior for the geometric types. 2016-03-30 17:25:03 -04:00
geo_selfuncs.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
geo_spgist.c Properly mark initRectBox() as taking 'void' args 2016-04-23 10:41:11 -04:00
inet_cidr_ntop.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
inet_net_pton.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
int.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
int8.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
json.c Fix typos. 2016-03-15 18:06:11 -04:00
jsonb.c Fix two-argument jsonb_object when called with empty arrays 2016-02-21 10:30:49 -05:00
jsonb_gin.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
jsonb_op.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
jsonb_util.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
jsonfuncs.c Add jsonb_insert 2016-04-06 19:25:00 +03:00
levenshtein.c Remove new coupling between NAMEDATALEN and MAX_LEVENSHTEIN_STRLEN. 2016-01-22 11:53:06 -05:00
like.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
like_match.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
lockfuncs.c Provide much better wait information in pg_stat_activity. 2016-03-10 12:44:09 -05:00
mac.c Allow input format xxxx-xxxx-xxxx for macaddr type 2014-10-21 16:16:39 -04:00
misc.c Create default roles 2016-04-08 16:56:27 -04:00
nabstime.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
name.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
network.c Add geometry/range functions to support BRIN inclusion 2015-05-05 15:22:24 -03:00
network_gist.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
network_selfuncs.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
numeric.c Fix corner-case loss of precision in numeric pow() calculation 2016-05-05 11:16:17 +01:00
numutils.c Use PG_INT32_MIN instead of reiterating the constant. 2016-04-13 07:54:45 -04:00
oid.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
oracle_compat.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
orderedsetaggs.c Reuse abbreviated keys in ordered [set] aggregates. 2016-02-17 15:40:00 +05:30
pg_locale.c Avoid multiple free_struct_lconv() calls on same data. 2016-02-28 23:39:20 -05:00
pg_lsn.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_upgrade_support.c In pg_dump, include pg_catalog and extension ACLs, if changed 2016-04-06 21:45:32 -04:00
pgstatfuncs.c Prevent possible crash reading pg_stat_activity. 2016-04-21 14:02:15 -04:00
pseudotypes.c Restructure index access method API to hide most of it at the C level. 2016-01-17 19:36:59 -05:00
quote.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
rangetypes.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
rangetypes_gist.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
rangetypes_selfuncs.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
rangetypes_spgist.c Use traversalValue in SP-GiST range opclass. 2016-03-30 18:38:53 +03:00
rangetypes_typanalyze.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
regexp.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
regproc.c Make the to_reg*() functions accept text not cstring. 2016-01-05 13:02:43 -05:00
ri_triggers.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
rowtypes.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
ruleutils.c Fix assorted missing infrastructure for ON CONFLICT. 2016-05-11 16:20:23 -04:00
selfuncs.c Revert CREATE INDEX ... INCLUDING ... 2016-04-08 21:52:13 +03:00
tid.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
timestamp.c Add parallel query support functions for assorted aggregates. 2016-04-05 14:32:53 -04:00
trigfuncs.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
tsginidx.c Tweak a few more things in preparation for upcoming pgindent run. 2016-05-03 10:52:25 -04:00
tsgistidx.c Phrase full text search. 2016-04-07 18:44:18 +03:00
tsquery.c Restore original tsquery operation numbering. 2016-04-08 20:11:30 +03:00
tsquery_cleanup.c Zeroing unused parts ducring tsquery construction. 2016-04-07 20:45:24 +03:00
tsquery_gist.c Create stub functions to support pg_upgrade of old contrib/tsearch2. 2016-03-02 17:37:54 -05:00
tsquery_op.c Fix whitespace 2016-04-11 14:44:51 -04:00
tsquery_rewrite.c Widen query numbers-of-tuples-processed counters to uint64. 2016-03-12 16:05:29 -05:00
tsquery_util.c Phrase full text search. 2016-04-07 18:44:18 +03:00
tsrank.c Phrase full text search. 2016-04-07 18:44:18 +03:00
tsvector.c Rename comparePos() to compareWordEntryPos() 2016-04-08 12:04:15 +03:00
tsvector_op.c Rename tsvector delete() to ts_delete(), and filter() to ts_filter(). 2016-05-05 19:43:32 -04:00
tsvector_parser.c Phrase full text search. 2016-04-07 18:44:18 +03:00
txid.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
uuid.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
varbit.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
varchar.c Extend sortsupport for text to more opclasses. 2016-02-03 14:29:53 -05:00
varlena.c Disable abbreviated keys for string-sorting in non-C locales. 2016-03-23 16:03:13 -04:00
version.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
windowfuncs.c Fix typos. 2016-03-15 18:06:11 -04:00
xid.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
xml.c Widen query numbers-of-tuples-processed counters to uint64. 2016-03-12 16:05:29 -05:00