Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1at3j5-0006iV-VH for pgsql-general@arkaria.postgresql.org; Thu, 21 Apr 2016 01:48:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1at3j5-0004CQ-HD for pgsql-general@arkaria.postgresql.org; Thu, 21 Apr 2016 01:48:15 +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 1at3j4-0004CJ-Ud for pgsql-general@postgresql.org; Thu, 21 Apr 2016 01:48:14 +0000 Received: from vapor.isi.edu ([128.9.64.64]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1at3j1-0006N5-Fz for pgsql-general@postgresql.org; Thu, 21 Apr 2016 01:48:14 +0000 Received: from moraine.isi.edu (moraine.isi.edu [128.9.64.90]) by vapor.isi.edu (8.13.8/8.13.8) with ESMTP id u3L1lhT0013715; Wed, 20 Apr 2016 18:47:43 -0700 (PDT) Date: Wed, 20 Apr 2016 18:47:36 -0700 From: Karl Czajkowski To: Tom Lane Cc: pgsql-general@postgresql.org Subject: Re: RLS policy dump/restore failure due to elided type-casts Message-ID: <20160421014736.GD7976@moraine.isi.edu> References: <20160421001832.GB7976@moraine.isi.edu> <18967.1461201440@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18967.1461201440@sss.pgh.pa.us> X-ISI-4-43-8-MailScanner: Found to be clean X-MailScanner-From: karlcz@isi.edu X-Pg-Spam-Score: -7.9 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On Apr 20, Tom Lane modulated: > Karl Czajkowski writes: > > CREATE POLICY delete_stuff ON stuff > > FOR DELETE USING ('example attribute value' = ANY ( ((SELECT current_attributes()))::text[] )); > > Just out of curiosity, why are you doing it like that, and not simply > > USING ('example attribute value' = ANY (current_attributes())) > > It seems like you're going out of your way to complicate matters. > > regards, tom lane > Going out of my way to complicate matters is my specialty. :-) I spend more of my time writing programs that generate and transform SQL from domain-specific languages, rather than writing SQL by hand. In this case, I think I composed the subquery reflexively without thinking that there is a more direct idiom for this case... Karl -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general