aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_expr.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-11-16 16:39:59 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2020-11-16 16:39:59 -0500
commit84e31622882358f61e9d3c16c5b4f3187f504a68 (patch)
tree162bd2b442e56f3b40be6559c22a8d6d01ba6108 /src/backend/parser/parse_expr.c
parent89aa30a179686d86aeccddf715f039d1a15d2b30 (diff)
downloadpostgresql-84e31622882358f61e9d3c16c5b4f3187f504a68.tar.gz
postgresql-84e31622882358f61e9d3c16c5b4f3187f504a68.zip
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
Diffstat (limited to 'src/backend/parser/parse_expr.c')
0 files changed, 0 insertions, 0 deletions