On Fri, Sep 22, 2023 at 2:35 PM jian he <jian.universal...@gmail.com> wrote: > > /* TODO: Handle NULL inputs? */ > since interval_avg_serialize is strict, so handle null would be like: > if (PG_ARGISNULL(0)) then PG_RETURN_NULL();
That's automatically taken care of by the executor. Functions need to handle NULL inputs if they are *not* strict. #select proisstrict from pg_proc where proname = 'interval_avg_serialize'; proisstrict ------------- t (1 row) #select proisstrict from pg_proc where proname = 'interval_avg_deserialize'; proisstrict ------------- t (1 row) -- Best Wishes, Ashutosh Bapat