Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yg1KA-0005rY-Hn for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Apr 2015 01:32:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yg1K9-0005ra-8n for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Apr 2015 01:32:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yg1K8-0005rT-BM for pgsql-bugs@postgresql.org; Thu, 09 Apr 2015 01:32:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yg1Jz-0003rJ-SJ for pgsql-bugs@postgresql.org; Thu, 09 Apr 2015 01:32:03 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t391VqQ8022651; Wed, 8 Apr 2015 21:31:52 -0400 From: Tom Lane To: Jeff Davis cc: pgsql-bugs@postgresql.org Subject: Re: Failure to coerce unknown type to specific type In-reply-to: References: Comments: In-reply-to Jeff Davis message dated "Wed, 08 Apr 2015 18:21:44 -0700" Date: Wed, 08 Apr 2015 21:31:52 -0400 Message-ID: <1430.1428543112@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 Jeff Davis 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs