Running the following against HEAD and REL8_3_6:
create table foo (a varchar(500));
create view bar as select case foo.a when '1' then 'foo' else 'bar' end as fa from foo;
\d bar
Causes as assertion in the backend:
TRAP: FailedAssertion("!(((((Node*)(((list_head(((OpExpr *) w)->args))->data.ptr_value)))->type) == T_CaseTestExpr) || ((((Node*)(((list_head(((OpExpr *) w)->args))->data.ptr_value)))->type) == T_Const))", File: "ruleutils.c", Line: 4587
)
LOG: server process (PID 28408) was terminated by signal 6: Aborted
Attached is a simple patch that appears to fix this problem, not sure if it suffices in general.
Alan