Remove special checks for pg_rewrite.ev_qual and ev_action being NULL.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: e1339bfc7a2fd4629e1c3f8f919ddd05b4745e13
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2020-11-02T19:34:34Z
Releases: 14.0
Remove special checks for pg_rewrite.ev_qual and ev_action being NULL.

make_ruledef() and make_viewdef() were coded to cope with possible
null-ness of these columns, but they've been marked BKI_FORCE_NOT_NULL
for some time.  So there's not really any need to do more than what
we do for the other columns of pg_rewrite, i.e. just Assert that
we got non-null results.

(There is a school of thought that says Asserts aren't the thing
to do to check for corrupt data, but surely here is not the place
to start if we want such a policy.)

Also, remove long-dead-if-indeed-it-ever-wasn't-dead handling of
an empty actions list in make_ruledef().  That's an error case
and should be treated as such.  (DO INSTEAD NOTHING is represented
by a CMD_NOTHING Query, not an empty list; cf transformRuleStmt.)

Kyotaro Horiguchi, some changes by me

Discussion: https://postgr.es/m/CAEudQApoA=tMTic6xEPYP_hsNZ8XtToVThK_0x7D_aFQYowq3w@mail.gmail.com

Files

PathChange+/−
src/backend/utils/adt/ruleutils.c modified +11 −15

Discussion