Re: [HACKERS] eval_const_expresisions and ScalarArrayOpExpr - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] eval_const_expresisions and ScalarArrayOpExpr
Date
Msg-id 16527.1494521109@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] eval_const_expresisions and ScalarArrayOpExpr  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
Heikki Linnakangas <hlinnaka@iki.fi> 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: [HACKERS] Safer and faster get_attstatsslot()
Next
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] export import bytea from psql