Re: Failure to coerce unknown type to specific type

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Failure to coerce unknown type to specific type
Date: 2015-04-09 01:31:52
Message-ID: 1430.1428543112@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Jeff Davis <pgsql(at)j-davis(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message digoal 2015-04-09 02:43:55 BUG #13004: PostgreSQL 9.5 policy for table bug?
Previous Message Jeff Davis 2015-04-09 01:21:44 Failure to coerce unknown type to specific type

Browse pgsql-hackers by date

  From Date Subject
Next Message Kouhei Kaigai 2015-04-09 01:48:44 Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)
Previous Message Jeff Davis 2015-04-09 01:21:44 Failure to coerce unknown type to specific type