From: Jeff Davis <pgsql@j-davis.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Failure to coerce unknown type to specific type
Date: Wed, 08 Apr 2015 23:18:20 -0700
Message-ID: <1428560300.2845.45.camel@jeff-desktop> (raw)
In-Reply-To: <1430.1428543112@sss.pgh.pa.us>
References: <CAMp0ubdECGUJWpQKyUM36PxQWoKe0VfTbHGHgn+w2H_5q1Nmow@mail.gmail.com>
<1430.1428543112@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On Wed, 2015-04-08 at 21:31 -0400, Tom Lane wrote:
> 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.
That example was just for illustration. My other example didn't require
creating a table at all:
SELECT a=b FROM (SELECT ''::text, ' ') x(a,b);
it's fine with me if we want that to fail, but I don't think we're
failing in the right place, or with the right error message.
I'm not clear on what rules we're applying such that the above query
should fail, but:
SELECT ''::text=' ';
should succeed. Unknown literals are OK, but unknown column references
are not? If that's the rule, can we catch that earlier, and throw an
error like 'column reference "b" has unknown type'?
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
Subject: Re: Failure to coerce unknown type to specific type
In-Reply-To: <1428560300.2845.45.camel@jeff-desktop>
References: <CAMp0ubdECGUJWpQKyUM36PxQWoKe0VfTbHGHgn+w2H_5q1Nmow@mail.gmail.com> <1430.1428543112@sss.pgh.pa.us> <1428560300.2845.45.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