Re: type coercion of record types - Mailing list pgsql-bugs

From Tom Lane
Subject Re: type coercion of record types
Date
Msg-id 995749.1785379496@sss.pgh.pa.us
Whole thread
In response to Re: type coercion of record types  (Arne Roland <arne.roland@malkut.net>)
List pgsql-bugs
Arne Roland <arne.roland@malkut.net> writes:
> Is there a particular reason we can't just error right here? Why can't 
> we just do something like the attached patch? That seems genuinely 
> simple to me.

The problem I've got with that is that coerce_record_to_complex
has no principled basis for giving that errhint: for all it knows,
the context could be something else entirely.  If we could throw that
error within coerce_fn_result_column, it'd be okay.

It does seem like a good idea to put something like

    if (pstate == NULL)
        elog(ERROR, "cannot handle whole-row Var without a pstate");

into coerce_record_to_complex, and we should certainly also update
the relevant function header comments so that they are not lies.
But that's just defense-in-depth; I don't want it to be the
user-visible behavior.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Arne Roland
Date:
Subject: Re: type coercion of record types
Next
From: "Tristan Partin"
Date:
Subject: Re: BUG #19586: money division overflow