Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aepUf-0000rU-Kn for pgsql-hackers@arkaria.postgresql.org; Sat, 12 Mar 2016 19:46:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aepUe-00070l-Jd for pgsql-hackers@arkaria.postgresql.org; Sat, 12 Mar 2016 19:46:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aepUd-00070e-RJ for pgsql-hackers@postgresql.org; Sat, 12 Mar 2016 19:46:31 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aepUa-0005rN-H5 for pgsql-hackers@postgresql.org; Sat, 12 Mar 2016 19:46:30 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 14137203F4 for ; Sat, 12 Mar 2016 14:46:27 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Sat, 12 Mar 2016 14:46:27 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=Lc2pVDlJBvXSOnRzlSv8Z1q++WQ=; b=pL+5H hvvUuefoc9j2IzZd3TzsyShM0tfxSLnmiFds6QT4L0CaLaYo7H7LTjo5HLgebOiW O2Ilbg/xPLW31tko5bUZ59zjqVLzYcgT6r6/GzrAJt4Zpfmfjl7LhfKmXiJQpiwU 3T/EVfc87VpK3ZmkjYo5fQCb0wXVbQ5HeniuqU= X-Sasl-enc: LipcWori+qaHMezwGO/0jkzcnDVVzDxfUKZYfwVdbr50 1457811986 Received: from intern.anarazel.de (c-73-158-95-199.hsd1.ca.comcast.net [73.158.95.199]) by mail.messagingengine.com (Postfix) with ESMTPA id B9EC4C00018; Sat, 12 Mar 2016 14:46:26 -0500 (EST) Date: Sat, 12 Mar 2016 11:46:25 -0800 From: Andres Freund To: Robert Haas Cc: "pgsql-hackers@postgresql.org" Subject: Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat Message-ID: <20160312194625.txlzu22xykgpu66n@alap3.anarazel.de> References: <20160312031502.lqtbqnqor4vji62k@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Hi, On 2016-03-12 11:56:24 -0500, Robert Haas wrote: > On Fri, Mar 11, 2016 at 10:15 PM, Andres Freund wrote: > > On 2016-01-28 19:09:01 +0000, Robert Haas wrote: > >> Only try to push down foreign joins if the user mapping OIDs match. > >> > >> Previously, the foreign join pushdown infrastructure left the question > >> of security entirely up to individual FDWs, but it would be easy for > >> a foreign data wrapper to inadvertently open up subtle security holes > >> that way. So, make it the core code's job to determine which user > >> mapping OID is relevant, and don't attempt join pushdown unless it's > >> the same for all relevant relations. > >> > >> Per a suggestion from Tom Lane. Shigeru Hanada and Ashutosh Bapat, > >> reviewed by Etsuro Fujita and KaiGai Kohei, with some further > >> changes by me. > > > > I noticed that this breaks some citus regression tests in a minor > > manner. Namely previously file_fdw worked without a user mapping, now it > > doesn't appear to anymore. > > > > This is easy enough to fix, and it's perfectly ok for us to fix this, > > but I do wonder if that's not going to cause trouble for others. > > Hmm, I didn't intend to change that. If that commit broke something, > there's obviously a hole in our regression test coverage. CREATE EXTENSION file_fdw; CREATE SERVER file_server FOREIGN DATA WRAPPER file_fdw; CREATE FOREIGN TABLE agg_csv ( a int2, b float4 ) SERVER file_server OPTIONS (format 'csv', filename '/home/andres/src/postgresql/contrib/file_fdw/data/agg.csv', header 'true', delimiter ';', quote '@', escape '"', null ''); SELECT * FROM agg_csv; worked in 9.5, but doesn't in master. The difference apears to be the check that's now in build_simple_rel() - there was nothing hitting the user mapping code before for file_fdw. - Andres -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers