Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VdVjL-0004Sp-Ar for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Nov 2013 01:46:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VdVjK-0005HE-Ip for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Nov 2013 01:46:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VdVjI-0005H3-Cu for pgsql-hackers@postgresql.org; Tue, 05 Nov 2013 01:46:52 +0000 Received: from outmail148093.authsmtp.net ([62.13.148.93]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VdVjF-0002yu-DP for pgsql-hackers@postgresql.org; Tue, 05 Nov 2013 01:46:52 +0000 Received: from mail-c235.authsmtp.com (mail-c235.authsmtp.com [62.13.128.235]) by punt14.authsmtp.com (8.14.2/8.14.2) with ESMTP id rA51kf6L038235; Tue, 5 Nov 2013 01:46:41 GMT Received: from ayaki.localdomain (124-148-67-24.dyn.iinet.net.au [124.148.67.24]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id rA51kYZE006026 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 5 Nov 2013 01:46:37 GMT Message-ID: <52784DF9.9040205@2ndquadrant.com> Date: Tue, 05 Nov 2013 09:46:33 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Robert Haas , Tom Lane CC: Stephen Frost , Josh Berkus , Kohei KaiGai , "ktm@rice.edu" , Alexander Korotkov , Oleg Bartunov , Greg Smith , PgHacker Subject: Re: [v9.4] row level security References: <521F7DFB.8060602@agliodbs.com> <5220D832.7090104@agliodbs.com> <20130830192729.GO2706@tamriel.snowman.net> <16798.1377891794@sss.pgh.pa.us> <1398.1378305956@sss.pgh.pa.us> <1543.1378306249@sss.pgh.pa.us> <2620.1378308159@sss.pgh.pa.us> <52775604.9090306@2ndquadrant.com> <11101.1383575839@sss.pgh.pa.us> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Server-Quench: 1de8f772-45bc-11e3-b802-002590a15da7 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZeVg0b BQteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksadwISJgVBAnde RXkJW1VXQF1wU2dz YQ5RIwRfZlRPWw10 Vk9XQFZNFgBqBAMA SFxvVxgpHm8zeH52 ZURkEHNfWkJ7O0cp F0YCEmoEeGNlOjMC UUENdB4GeANIYx9F aFV2VCIMZDFWYTQC El17DBAYFhZyEh9g CjITfBROdA4RGSF0 Qx0cEDFnBkAOWj8y Mw1O X-Authentic-SMTP: 61633235383639.1023:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 124.148.67.24/2525 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. 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 11/04/2013 11:17 PM, Robert Haas wrote: > I'd still like to here what's wrong with what I said here: > > http://www.postgresql.org/message-id/CA+TgmoYr1PHw3X9vnVuWDcfXkzK2p_jhtWc0fV2Q58NEgcxyTA@mail.gmail.com For me, just my understanding. I'm still too new to the planner and rewriter to grasp that properly as written. I was responding to Tom's objection, and he makes a good point about CASE and optimisation. We have to be free to re-order and pre-evaluate where LEAKPROOF flags make it safe and permissible, without ever otherwise doing so. That makes the SECURITY BARRIER subquery look better, since the limited pull-up / push-down is already implemented there. Robert, any suggesitons on how to approach what you suggest? I'm pretty new to the planner's guts, but I know there've been some complaints about the way the current RLS code fiddles with Vars when it changes a direct scan of a rel into a subquery scan. The code in: https://github.com/ringerc/postgres/blob/rls-9.4/src/backend/optimizer/prep/prepunion.c#L1647 and https://github.com/ringerc/postgres/blob/rls-9.4/src/backend/optimizer/prep/prepunion.c#L1591 seems to be the one folks were complaining about earlier. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers