Re: Failure to coerce unknown type to specific type - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Failure to coerce unknown type to specific type
Date
Msg-id 1430.1428543112@sss.pgh.pa.us
Whole thread Raw
In response to Failure to coerce unknown type to specific type  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Failure to coerce unknown type to specific type  (Jeff Davis <pgsql@j-davis.com>)
Re: Failure to coerce unknown type to specific type  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-bugs
Jeff Davis <pgsql@j-davis.com> writes:
> Original report and patch by Karl Schnaitter.
> create table a(u) as select '1';

We should, in fact, fail that to begin with.  Unknown-type columns are
a spectactularly horrid idea.

> This can be fixed by a small change (attached) to find_coercion_pathway to add:

>     else if (sourceTypeId == UNKNOWNOID)
>         result = COERCION_PATH_COERCEVIAIO;

This is not a good idea, I think.  I definitely don't accept any reasoning
that starts from the premise that UNKNOWN is a first-class type.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Jeff Davis
Date:
Subject: Failure to coerce unknown type to specific type
Next
From: Jeff Davis
Date:
Subject: Re: Failure to coerce unknown type to specific type