Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 63250632848 for ; Mon, 14 Dec 2009 23:32:30 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 04512-05 for ; Tue, 15 Dec 2009 03:32:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mail.postgresql.org (Postfix) with ESMTP id D5F7062DB89 for ; Mon, 14 Dec 2009 23:32:22 -0400 (AST) Received: by fxm27 with SMTP id 27so3822333fxm.3 for ; Mon, 14 Dec 2009 19:32:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=/onpaEeBmUJuOGWzMqKzMpEGpCvdvn/nsvkTpq5tJ4Y=; b=nsPP2sw2W9MS7S+SJhc7EMQqfx6055MUfcR+g0kaiDpYm14q3uN8bJvmmNyMPD9CBj PPnsU7w3PvL/EX/C6kVN6LjzvgR8KRFtbjoR2EniV3w4hEyP7OZ5FwiKIYPJMjCPNWLb Yv/+GwqsfI7aPClzezEfkqnb1GdkccUsB6jGE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=T0wXXyJdXnuybAqT1Xv2lK1/uuaK+7Zn8DQALPSvE40cT/ZNYsfVxNvlMAoA+63z18 jeuIJW5GN7oqXfyr5Mc+lvWfMYFG1wY1+w5sJJ79vvUMLff9K0MC3CrFlJROl3Fr0h4S eRbWbznct8NAkvxsjlo9MPNR6dqK/DbUws7Ps= MIME-Version: 1.0 Received: by 10.239.168.153 with SMTP id k25mr611304hbe.68.1260847940168; Mon, 14 Dec 2009 19:32:20 -0800 (PST) In-Reply-To: <4B26E910.4060604@ak.jp.nec.com> References: <20091212203003.GL17756@tamriel.snowman.net> <4B24AAED.2080706@kaigai.gr.jp> <603c8f070912130411q765c7e9aw371b468229b8e32@mail.gmail.com> <4B25C5B2.9010108@ak.jp.nec.com> <603c8f070912132135l43bdf060sa5207b5a4d2c918c@mail.gmail.com> <4B25DE99.2050801@ak.jp.nec.com> <603c8f070912140318i6bbc1d63o9e81d409d0b342b6@mail.gmail.com> <4B2626ED.7030104@kaigai.gr.jp> <20091214134714.GS17756@tamriel.snowman.net> <4B26E910.4060604@ak.jp.nec.com> Date: Mon, 14 Dec 2009 22:32:20 -0500 Message-ID: <603c8f070912141932k3ed0621cqc1051dfbf92a329f@mail.gmail.com> Subject: Re: Row-Level Security From: Robert Haas To: KaiGai Kohei Cc: Stephen Frost , KaiGai Kohei , Josh Berkus , pgsql-hackers@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/1301 X-Sequence-Number: 152004 2009/12/14 KaiGai Kohei : > IIRC, one headache issue is that user may provide well indexable conditions, > such as "SELECT * FROM view_x WHERE id = 1234". In this case, if we strictly > keep the order of evaluation between inside and outside of the view, its > performance penalty will over reasonable tradeoff to the better security. If you don't allow the indexable qual to be pushed down into the view in this situation, performance will be wretched. I think we need to distinguish between trusted and untrusted operations. Everything in the view definition is trusted. And some other things... perhaps access methods and some/most/all system catalog functions... are trusted. Other stuff is untrusted, and can't be pushed down. I think there was a previous discussion of this when Heikki first posted the issue to -hackers. ...Robert