Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yo3qm-0005V2-AZ for pgsql-bugs@arkaria.postgresql.org; Fri, 01 May 2015 05:51:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yo3ql-0003NG-QR for pgsql-bugs@arkaria.postgresql.org; Fri, 01 May 2015 05:50:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yo3qk-0003Lk-7P for pgsql-bugs@postgresql.org; Fri, 01 May 2015 05:50:58 +0000 Received: from mail-pa0-f44.google.com ([209.85.220.44]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Yo3qh-0003jo-EG for pgsql-bugs@postgresql.org; Fri, 01 May 2015 05:50:57 +0000 Received: by pacyx8 with SMTP id yx8so82116898pac.1 for ; Thu, 30 Apr 2015 22:50:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version:content-transfer-encoding; bh=4qw7k3GOwlqwVqj+5rCr4iVKaKOFYUT4tITJQ0ED1kY=; b=dhZIxvKQSrwjx6K4d6JjT85Wi7yajjKn8FHECP9AsRSFAFXIGACtSv0Vc0vFnGF6O9 i45hs0Mm2Wz0PINhmKDwOllN1FpkyfwmzoMmiF5A7HxGhVSc/4t9XBSCobtBXmsq63fy y+JlDZf4ZKFLxswiWVwt8i0r1teK34b9A0Xe0bffLiCGJIR7Cq2qRp9JedPxTa3Gcm0m ZFboazkNHLirJRZiiBm+J8RwOt2ToKK4fOysCJsooQ9v3naNdba3GWSAp2/6XqcAqUz7 hacXTFw/bj9cObIuBg2HsLTTcpyrpU2nGsFYxXOzPDBniq5refLcecePAdiPWAxlJ14Q RMDg== X-Gm-Message-State: ALoCoQkYHWecpfE3x63HiYBmx4xzyrCk/nKL0ttUMkOirHbhj9xHnZlqomCcJ3ZloMqa40VMeC0p X-Received: by 10.68.222.228 with SMTP id qp4mr14593090pbc.161.1430459452518; Thu, 30 Apr 2015 22:50:52 -0700 (PDT) Received: from [192.168.0.105] (c-69-181-249-16.hsd1.ca.comcast.net. [69.181.249.16]) by mx.google.com with ESMTPSA id qd8sm3786297pbc.71.2015.04.30.22.50.50 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Thu, 30 Apr 2015 22:50:51 -0700 (PDT) Message-ID: <1430459450.2499.17.camel@jeff-desktop> Subject: Re: Failure to coerce unknown type to specific type From: Jeff Davis To: Tom Lane Cc: Robert Haas , Postgres-Bugs Date: Thu, 30 Apr 2015 22:50:50 -0700 In-Reply-To: <35651.1430347071@sss.pgh.pa.us> References: <1430.1428543112@sss.pgh.pa.us> <35651.1430347071@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.8 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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