On 2020-06-10 18:00, Kyotaro Horiguchi wrote:
>
> + TupleDescInitEntry(tupdesc, (AttrNumber) 8, "last_plan",
>
> This could be a problem if we showed the last plan in this view. I
> think "last_plan_type" would be better.
>
> + if (prep_stmt->plansource->last_plan_type ==
> PLAN_CACHE_TYPE_CUSTOM)
> + values[7] = CStringGetTextDatum("custom");
> + else if (prep_stmt->plansource->last_plan_type ==
> PLAN_CACHE_TYPE_GENERIC)
> + values[7] = CStringGetTextDatum("generic");
> + else
> + nulls[7] = true;
>
> Using swith-case prevents future additional type (if any) from being
> unhandled. I think we are recommending that as a convension.
Thanks for your reviewing!
I've attached a patch that reflects your comments.
Regards,
--
Atsushi Torikoshi