Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8rEv-0002to-KI for pgsql-hackers@arkaria.postgresql.org; Thu, 11 May 2017 16:46:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d8rEv-0006Ew-71 for pgsql-hackers@arkaria.postgresql.org; Thu, 11 May 2017 16:46:57 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d8rDP-0003Id-Pi for pgsql-hackers@postgresql.org; Thu, 11 May 2017 16:45:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d8rDM-0004Gm-2i for pgsql-hackers@postgresql.org; Thu, 11 May 2017 16:45:22 +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 v4BGj9jq016528; Thu, 11 May 2017 12:45:09 -0400 From: Tom Lane To: Heikki Linnakangas cc: pgsql-hackers Subject: Re: eval_const_expresisions and ScalarArrayOpExpr In-reply-to: <4b14a9a5-01c2-4042-3ec9-cf27149302a5@iki.fi> References: <3be3b82c-e29c-b674-2163-bf47d98817b1@iki.fi> <23186.1494516060@sss.pgh.pa.us> <4b14a9a5-01c2-4042-3ec9-cf27149302a5@iki.fi> Comments: In-reply-to Heikki Linnakangas message dated "Thu, 11 May 2017 19:20:55 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16526.1494521109.1@sss.pgh.pa.us> Date: Thu, 11 May 2017 12:45:09 -0400 Message-ID: <16527.1494521109@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 Heikki Linnakangas writes: > On 05/11/2017 06:21 PM, Tom Lane wrote: >>> On a side-note, I find it a bit awkward that ScalarArrayOpExpr uses a >>> 2-element List to hold the scalar and array arguments. Wouldn't it be >>> much more straightforward to have explicit "Expr *scalararg" and "Expr >>> *arrayarg" fields? >> I think it's modeled on OpExpr, which also uses a list though you could >> argue for separate leftarg and rightarg fields instead. > Yeah, I think that would be better for OpExpr, too. (For an unary > operator, rightarg would be unused.) I should think leftarg is the one that would go unused, for a normal prefix unary operator. But it seems like changing this would be way more invasive than it's really worth. We'd save a couple of List cells per operator, which is certainly something, but I'm afraid you'd be touching a heck of a lot of code. And there are a nontrivial number of places that share argument-processing with FuncExprs, which such a change would break. 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