Re: [GENERAL] Empty arrays with ARRAY[] - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Empty arrays with ARRAY[]
Date
Msg-id 23298.1196183991@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Empty arrays with ARRAY[]  ("Brendan Jurd" <direvus@gmail.com>)
Responses Re: [GENERAL] Empty arrays with ARRAY[]  ("Brendan Jurd" <direvus@gmail.com>)
List pgsql-hackers
"Brendan Jurd" <direvus@gmail.com> writes:
> Now I'm thinking I leave the grammar rules alone (apart from making it
> legal to specify an empty list of elements), and instead push the
> typename down into the child node from makeTypeCast(), if the child is
> an A_ArrayExpr.  Does that work better?

Actually, if you do that you might as well forego the separate node type
(which requires a nontrivial amount of infrastructure).  I think it
would work just about as well to have transformExpr check whether the
argument of a TypeCast is an ArrayExpr, and if so call
transformArrayExpr directly from there, passing the TypeName as an
additional argument.  Kinda ugly, but not really any worse than the way
A_Const is handled in that same routine.  (In fact, we could use the
same technique to get rid of the typename field in A_Const ... might
be worth doing?)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Help with release note items
Next
From: Simon Riggs
Date:
Subject: Quality and Performance