Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cswnV-00010i-H4 for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 19:28:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cswnT-00078b-EY for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 19:28:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cswnS-00078R-3Z for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 19:28:50 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cswnO-0004gw-RZ for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 19:28:49 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id AFEC62089B; Tue, 28 Mar 2017 15:28:45 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Tue, 28 Mar 2017 15:28:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=Z7Y954WMdfybZ7ayiJ AkJFbAi9YNSsvCLMGxk2FyYYY=; b=Oe/rq0+wYzAs1uiCXyHlcHM58n/9jPNMh/ G4HzGa24IVYbEeKFemjAj1AV1tVKOSeJ4aSk/wcRl2iqlEmYw3lZiIWB17RPs/y0 FGaZmBuS43WWSAjC7jNkNAu8NsUhnY6oxnWJtvLBM/2dDBra92aH/OJGl3GpfIXX SmulsHmT5kUMgD7Rp1yLhB/Ro+f8uEFrTeAIDMBoLNBaI8pThz+6LAYn43Ngswr3 yNqWvKXAjJwLwf4TwouznyDqUqIEJGDtYMj5RLyBdBFqe/kG5Xp8e2Un9zE+XD/v tOxStrHC0Cy76mF+d9arW6Vy5gD40WGvd74XN1+vkxYJLNFDNtIw== X-ME-Sender: X-Sasl-enc: 4lrPUcthLbWtLQPtwJchdhsm5CuF+VJSf8JM7DsL7JKc 1490729325 Received: from intern.anarazel.de (unknown [208.123.164.34]) by mail.messagingengine.com (Postfix) with ESMTPA id 7C328242B6; Tue, 28 Mar 2017 15:28:45 -0400 (EDT) Date: Tue, 28 Mar 2017 12:28:45 -0700 From: Andres Freund To: Tom Lane Cc: pgsql-hackers@postgresql.org Subject: Re: Protection lost in expression eval changeover Message-ID: <20170328192845.kfd7yp7vt44vuofa@alap3.anarazel.de> References: <16803.1490723570@sss.pgh.pa.us> <20170328181324.e47nypa4vqg3dpk4@alap3.anarazel.de> <19025.1490726618@sss.pgh.pa.us> <20170328185104.yxs2ewbmb5wl4la7@alap3.anarazel.de> <19433.1490727242@sss.pgh.pa.us> <22347.1490729068@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22347.1490729068@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2017-03-28 15:24:28 -0400, Tom Lane wrote: > I wrote: > > Andres Freund writes: > >> On 2017-03-28 14:43:38 -0400, Tom Lane wrote: > >>> I don't see a strong reason why we need to allow a dropped column to go > >>> to null while we throw an immediate error for a change in column type. > >>> (If there is some reason, hopefully beta testing will find it.) > > >> Ok. You're doing that? > > > Yeah, I'll go do that. > > Or maybe not: turns out we have regression test cases that depend on this > behavior, cf the bit in create_view.sql about > > -- this perhaps should be rejected, but it isn't: > alter table tt14t drop column f3; > -- f3 is still in the view but will read as nulls > > You'd proposed changing that, which I agree with in principle, but > I thought your patch wasn't right. Maybe we need to work harder on > that. > > (I'm not actually sure right at the moment why this case isn't failing > in HEAD. Maybe plpgsql is replacing the dropped column with nulls in > its result rows, so that whether the outer query special-cases them or > not doesn't affect the visible output.) > > Or we could just throw an error anyway. I'm not sure there's any > strong reason to allow such cases to work. I think the regression > tests were only put there to ensure they don't crash, not to memorialize > behavior we consider essential. Yea, cases like that was what I was referring to with changing behaviour - I think it's ok to error out, as long as we do so reliably. - Andres -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers