postgresql/src/include
Peter Eisentraut 1ffa59a85c Fix optimization of foreign-key on update actions
In RI_FKey_pk_upd_check_required(), we check among other things
whether the old and new key are equal, so that we don't need to run
cascade actions when nothing has actually changed.  This was using the
equality operator.  But the effect of this is that if a value in the
primary key is changed to one that "looks" different but compares as
equal, the update is not propagated.  (Examples are float -0 and 0 and
case-insensitive text.)  This appears to violate the SQL standard, and
it also behaves inconsistently if in a multicolumn key another key is
also updated that would cause the row to compare as not equal.

To fix, if we are looking at the PK table in ri_KeysEqual(), then do a
bytewise comparison similar to record_image_eq() instead of using the
equality operators.  This only makes a difference for ON UPDATE
CASCADE, but for consistency we treat all changes to the PK the same.  For
the FK table, we continue to use the equality operators.

Discussion: https://www.postgresql.org/message-id/flat/3326fc2e-bc02-d4c5-e3e5-e54da466e89a@2ndquadrant.com
2019-03-18 17:19:21 +01:00
..
access Avoid casting away a const 2019-03-16 10:13:03 +01:00
bootstrap Update copyright for 2019 2019-01-02 12:44:25 -05:00
catalog Partial implementation of SQL/JSON path language 2019-03-16 12:16:48 +03:00
commands Use slots in trigger infrastructure, except for the actual invocation. 2019-02-26 20:31:38 -08:00
common Refactor more code logic to update the control file 2019-03-18 12:59:35 +09:00
datatype Update copyright for 2019 2019-01-02 12:44:25 -05:00
executor Allow ATTACH PARTITION with only ShareUpdateExclusiveLock. 2019-03-07 11:13:12 -05:00
fe_utils pgbench: add \cset and \gset commands 2019-01-10 13:42:20 -03:00
foreign Store tuples for EvalPlanQual in slots, rather than as HeapTuples. 2019-03-01 10:37:57 -08:00
jit Renaming for new subscripting mechanism 2019-02-01 12:50:32 -03:00
lib simplehash: Add support for resetting a hashtable's contents. 2019-02-09 01:05:49 -08:00
libpq Add new clientcert hba option verify-full 2019-03-09 12:19:47 -08:00
mb Update copyright for 2019 2019-01-02 12:44:25 -05:00
nodes Refactor ParamListInfo initialization 2019-03-14 13:30:09 +01:00
optimizer Fix handling of targetlist SRFs when scan/join relation is known empty. 2019-03-07 14:22:13 -05:00
parser Create the infrastructure for planner support functions. 2019-02-09 18:08:48 -05:00
partitioning Update copyright year in files added by 1bb5e78218. 2019-03-16 16:00:38 +05:30
port Fix previous MinGW fix. 2019-02-16 15:23:02 +00:00
portability Update copyright for 2019 2019-01-02 12:44:25 -05:00
postmaster Convert [autovacuum_]vacuum_cost_delay into floating-point GUCs. 2019-03-10 15:01:39 -04:00
regex Partial implementation of SQL/JSON path language 2019-03-16 12:16:48 +03:00
replication Add walreceiver API to get remote server version 2019-03-15 10:16:26 +01:00
rewrite Update copyright for 2019 2019-01-02 12:44:25 -05:00
snowball Update copyright for 2019 2019-01-02 12:44:25 -05:00
statistics Rename nodes/relation.h to nodes/pathnodes.h. 2019-01-29 16:49:25 -05:00
storage Enable parallel query with SERIALIZABLE isolation. 2019-03-15 17:47:04 +13:00
tcop Update copyright for 2019 2019-01-02 12:44:25 -05:00
tsearch Update copyright for 2019 2019-01-02 12:44:25 -05:00
utils Fix optimization of foreign-key on update actions 2019-03-18 17:19:21 +01:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Use an unsigned char for bool if we don't use the native bool. 2019-02-20 21:31:02 +00:00
fmgr.h Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
funcapi.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
getaddrinfo.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
getopt_long.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
Makefile Fix make rules for jsonpath grammar making them similar to SQL grammar 2019-03-17 10:55:52 +03:00
miscadmin.h Convert [autovacuum_]vacuum_cost_delay into floating-point GUCs. 2019-03-10 15:01:39 -04:00
pg_config_ext.h.in
pg_config_ext.h.win32
pg_config_manual.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_config.h.in Make use of compiler builtins and/or assembly for CLZ, CTZ, POPCNT. 2019-02-15 23:22:33 -05:00
pg_config.h.win32 Make use of compiler builtins and/or assembly for CLZ, CTZ, POPCNT. 2019-02-15 23:22:33 -05:00
pg_getopt.h Use our own getopt() on OpenBSD. 2019-01-18 15:06:26 -05:00
pg_trace.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pgstat.h Use condition variables to wait for checkpoints. 2019-03-14 10:59:33 +13:00
pgtar.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pgtime.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
port.h Cygwin and Mingw floating-point fixes. 2019-02-16 01:50:16 +00:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
postgres.h Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
rusagestub.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
windowapi.h Update copyright for 2019 2019-01-02 12:44:25 -05:00