Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions
Date
Msg-id CADkLM=f0xruKRH+6XvCsM1EVic9y4BL4AFo3VUfvRLdu-Qp5Gg@mail.gmail.com
Whole thread Raw
In response to Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
> +               /*
> +                * Here, we cannot deparsing cast_expr directly, since
> +                * transformTypeSafeCast may have folded it into a simple
> +                * constant or NULL. Instead, we use source_expr and
> +                * default_expr to reconstruct the CAST DEFAULT clause.
> +                */
>
> I am wondering how other places handle expression deparsing; do they
> hold the original expression along with the transformed expression?

In my initial implementation of this, I modified CoalesceExpr to ensure that the default clause was evaluated if and only if the initial expression failed.

 
rebased, many variable names have been renamed, comments adjusted.

The new SAFE option on user defined cast functions looks good to me.

I am concerned that adding _safe overhead to all cast functions will be received poorly, but if it is poorly received then reverting isn't that hard.

I'm going to re-review the whole patch set, but I wanted to say that I like the main points of the changes so far.

pgsql-hackers by date:

Previous
From: "Jelte Fennema-Nio"
Date:
Subject: Re: libpq: Bump protocol version to version 3.2 at least until the first/second beta
Next
From: "David G. Johnston"
Date:
Subject: Re: Patch: dumping tables data in multiple chunks in pg_dump