Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bi6lK-0000w3-HN for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Sep 2016 21:21:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bi6lJ-0002W4-Iu for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Sep 2016 21:21:33 +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 1bi6lI-0002Vo-QV for pgsql-hackers@postgresql.org; Thu, 08 Sep 2016 21:21:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bi6lF-0002xH-Qy for pgsql-hackers@postgresql.org; Thu, 08 Sep 2016 21:21:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u88LLPUP005612; Thu, 8 Sep 2016 17:21:25 -0400 From: Tom Lane To: Stephen Frost cc: Alvaro Herrera , Robert Haas , Thom Brown , "pgsql-hackers@postgresql.org" Subject: Re: Add support for restrictive RLS policies In-reply-to: <20160908200912.GW4028@tamriel.snowman.net> References: <20160908183544.GU4028@tamriel.snowman.net> <20160908192157.GA53172@alvherre.pgsql> <20160908200912.GW4028@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Thu, 08 Sep 2016 16:09:12 -0400" Date: Thu, 08 Sep 2016 17:21:25 -0400 Message-ID: <5611.1473369685@sss.pgh.pa.us> X-Pg-Spam-Score: -3.0 (---) 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 Stephen Frost writes: > * Alvaro Herrera (alvherre@2ndquadrant.com) wrote: >> Can't you keep those words as Sconst or something (DefElems?) until the >> execution phase, so that they don't need to be keywords at all? > Seems like we could do that, though I'm not convinced that it really > gains us all that much. These are only unreserved keywords, of course, > so they don't impact users the way reserved keywords (of any kind) can. > While there may be some places where we use a string to represent a set > of defined options, I don't believe that's typical -1 for having to write them as string literals; but I think what Alvaro really means is to arrange for the words to just be identifiers in the grammar, which you strcmp against at execution. See for example reloption_list. (Whether you use DefElem as the internal representation is a minor detail, though it might help for making the parsetree copyObject-friendly.) vacuum_option_elem shows another way to avoid making a word into a keyword, although to me that one is more of an antipattern; it'd be better to leave the strcmp to execution, since there's so much other code that does things that way. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers