From: Jeff Davis <pgsql@j-davis.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Postgres-Bugs <pgsql-bugs@postgresql.org>
Subject: Re: Failure to coerce unknown type to specific type
Date: Thu, 30 Apr 2015 22:50:50 -0700
Message-ID: <1430459450.2499.17.camel@jeff-desktop> (raw)
In-Reply-To: <35651.1430347071@sss.pgh.pa.us>
References: <CAMp0ubdECGUJWpQKyUM36PxQWoKe0VfTbHGHgn+w2H_5q1Nmow@mail.gmail.com>
<1430.1428543112@sss.pgh.pa.us>
<CA+Tgmoav4gswNkA39SYdb3SdSBfrcHmU08=nXLNbxMZFg7UYsw@mail.gmail.com>
<35651.1430347071@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On Wed, 2015-04-29 at 15:37 -0700, Tom Lane wrote:
> We should IMO, but there's been push-back about backwards compatibility
> when this has been proposed in the past. But I'd rather break backwards
> compatibility to the extent of saying "you can't do that" than to try to
> make unknown a full-fledged type, which is what this patch wants to do.
My intention was to make can_coerce_type and coerce_type consistent --
right now, coerce_type can fail after can_coerce_type returns true.
(I also wanted to improve the composability of subqueries, but I got
enough resistance that I'm setting that argument aside.)
It really has nothing to do with creating real tables with real columns
of type unknown.
=> select u=t from (select 'x' as u, 'y'::text as t) s;
ERROR: failed to find conversion function from unknown to text
That's an elog (not an ereport, just plain elog) for what is a
high-level query compilation error of a fairly sane-looking query, which
seems wrong.
The code comment above the error says that the caller blew it, but as
far as I can tell there's nothing the caller can do about it. That seems
wrong, too.
Regards,
Jeff Davis
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: pgsql@j-davis.com, tgl@sss.pgh.pa.us, robertmhaas@gmail.com
Subject: Re: Failure to coerce unknown type to specific type
In-Reply-To: <1430459450.2499.17.camel@jeff-desktop>
References: <CAMp0ubdECGUJWpQKyUM36PxQWoKe0VfTbHGHgn+w2H_5q1Nmow@mail.gmail.com> <1430.1428543112@sss.pgh.pa.us> <CA+Tgmoav4gswNkA39SYdb3SdSBfrcHmU08=nXLNbxMZFg7UYsw@mail.gmail.com> <35651.1430347071@sss.pgh.pa.us> <1430459450.2499.17.camel@jeff-desktop>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox