Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yoy2D-0004cN-Ob for pgsql-bugs@arkaria.postgresql.org; Sun, 03 May 2015 17:50:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yoy2C-00085q-HQ for pgsql-bugs@arkaria.postgresql.org; Sun, 03 May 2015 17:50:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yoy2A-00085h-Hi for pgsql-bugs@postgresql.org; Sun, 03 May 2015 17:50:30 +0000 Received: from mail-pa0-f45.google.com ([209.85.220.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Yoy23-0000ez-I6 for pgsql-bugs@postgresql.org; Sun, 03 May 2015 17:50:29 +0000 Received: by pacyx8 with SMTP id yx8so141078576pac.1 for ; Sun, 03 May 2015 10:50:22 -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=NvXrRv+VzC972Osz8I8FnniuFcmadGneshHPmczDjJI=; b=DGkKphZL7E1Tie3ctxnXAmCHpBxKn7nZNKeGNFwyDSaRClM+Kz/SxO7v92nEp93KIO vJ+/H7QcBn+vzb1/ax3eCtUrJJUN9HuxBzHuQuMHpLeFEl5imzvxf1Q5bvQWHxkn+HXz xv9T1aS/5dRGd0bLhi64xLMS90jPNn6BNcaoj4nlnYNbloMkqF+21sd1rUfUPzP5SQzB dvEfVa9CcvAPtahzfvpvADNJkFcFhacVclVO17H4AUy8EE9WB2YIVfjjELLg33jl0RSt 00PuXfCnHCZfiMS4+OgOI4TTFEWUCbJbNfXtD9MnBBll+BvgPYFDPJG1POrb8YQzcmGT G0aQ== X-Gm-Message-State: ALoCoQnFXDzZnVPCOxWnQYxunBUTOZ4YAzZEHhf4I17GPZuL5IyydjhriOlxf993gbxYDZ4XfvCL X-Received: by 10.68.57.132 with SMTP id i4mr36318909pbq.138.1430675422062; Sun, 03 May 2015 10:50:22 -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 cp10sm10466502pdb.44.2015.05.03.10.50.20 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Sun, 03 May 2015 10:50:21 -0700 (PDT) Message-ID: <1430675419.2464.0.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: Sun, 03 May 2015 10:50:19 -0700 In-Reply-To: <16364.1430672448@sss.pgh.pa.us> References: <1430.1428543112@sss.pgh.pa.us> <35651.1430347071@sss.pgh.pa.us> <1430459450.2499.17.camel@jeff-desktop> <37798.1430500134@sss.pgh.pa.us> <1430603756.2499.44.camel@jeff-desktop> <16364.1430672448@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.6 (--) 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 Sun, 2015-05-03 at 13:00 -0400, Tom Lane wrote: > I don't think there's any useful alternative to failing on this type of > case. You can't realistically postpone resolution of the subquery output > types long enough for outer-level expression resolution to provide > context. Even if you could, the behavior wouldn't be very well defined, > because (as you note) there might be more than one such expression leading > to contradictory results. > > I think it's reasonable to try to let context inform resolution of the > subquery output types where there is exactly one immediate source of > context, such as the INSERT/SELECT case or UNION/INTERSECT/EXCEPT cases. > (Upthread, Kevin whines about our handling of UNION, but that's possibly > fixable.) OK, your proposal sounds good to me then. 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