Re: RLS policy dump/restore failure due to elided type-casts - Mailing list pgsql-general

From Karl Czajkowski
Subject Re: RLS policy dump/restore failure due to elided type-casts
Date
Msg-id 20160421014736.GD7976@moraine.isi.edu
Whole thread Raw
In response to Re: RLS policy dump/restore failure due to elided type-casts  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: RLS policy dump/restore failure due to elided type-casts
List pgsql-general
On Apr 20, Tom Lane modulated:
> Karl Czajkowski <karlcz@isi.edu> 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



pgsql-general by date:

Previous
From: Karl Czajkowski
Date:
Subject: Re: RLS policy dump/restore failure due to elided type-casts
Next
From: Tom Lane
Date:
Subject: Re: RLS policy dump/restore failure due to elided type-casts