postgresql/src/backend
Tom Lane fea5960faf Do not return NULL for error cases in satisfies_hash_partition().
Since this function is used as a CHECK constraint condition,
returning NULL is tantamount to returning TRUE, which would have the
effect of letting in a row that doesn't satisfy the hash condition.
Admittedly, the cases for which this is done should be unreachable
in practice, but that doesn't make it any less a bad idea.  It also
seems like a dartboard was used to decide which error cases should
throw errors as opposed to returning NULL.

For the checks for NULL input values, I just switched it to returning
false.  There's some argument that an error would be better; but the
case really should be can't-happen in a generated hash constraint,
so it's likely not worth more code for.

For the parent-relation-open-failure case, it seems like we might
as well let relation_open throw an error, instead of having an
impossible-to-diagnose constraint failure.

Back-patch to v11 where this code came in.

Discussion: https://postgr.es/m/24067.1605134819@sss.pgh.pa.us
2020-11-16 16:39:59 -05:00
..
access Remove duplicate code in brin_memtuple_initialize 2020-11-11 18:46:25 +01:00
bootstrap Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
catalog Plug memory leak in index_get_partition 2020-11-06 22:52:15 -03:00
commands Use "true" not "TRUE" in one ICU function call. 2020-11-16 15:16:39 -05:00
executor In INSERT/UPDATE, use the table's real tuple descriptor as target. 2020-11-08 13:08:36 -05:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit llvmjit: Work around bug in LLVM 3.9 causing crashes after 72559438f9. 2020-10-15 18:17:00 -07:00
lib Use pg_bitutils for HyperLogLog. 2020-07-30 09:17:00 -07:00
libpq Message style improvements 2020-11-07 19:33:43 -03:00
main Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nodes Add for_each_from, to simplify loops starting from non-first list cells. 2020-09-28 20:32:53 -04:00
optimizer Fix get_useful_pathkeys_for_relation for volatile expressions 2020-11-03 22:32:34 +01:00
parser Calculate extraUpdatedCols in query rewriter, not parser. 2020-10-28 13:47:02 -04:00
partitioning Do not return NULL for error cases in satisfies_hash_partition(). 2020-11-16 16:39:59 -05:00
po Translation updates 2020-11-09 12:34:05 +01:00
port Spelling adjustments 2020-06-07 15:06:51 +02:00
postmaster Use _exit(2) for SIGQUIT during ProcessStartupPacket, too. 2020-09-10 12:06:26 -04:00
regex Dial back -Wimplicit-fallthrough to level 3 2020-05-13 15:31:14 -04:00
replication doc: wire protocol data type for history file content is bytea 2020-11-12 14:33:28 -05:00
rewrite Calculate extraUpdatedCols in query rewriter, not parser. 2020-10-28 13:47:02 -04:00
snowball Update copyrights for 2020 2020-01-01 12:21:45 -05:00
statistics Run pgindent with new pg_bsd_indent version 2.1.1. 2020-05-16 11:54:51 -04:00
storage Extend PageIsVerified() to handle more custom options 2020-11-02 10:41:23 +09:00
tcop Fix bogus completion tag usage in walsender 2020-09-16 21:16:25 -03:00
tsearch Avoid possible dangling-pointer access in tsearch_readline_callback. 2020-09-23 11:36:13 -04:00
utils Fix and simplify some usages of TimestampDifference(). 2020-11-10 22:51:55 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Update copyrights for 2020 2020-01-01 12:21:45 -05:00
nls.mk Translation updates 2020-09-14 13:14:53 +02:00