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

From Tom Lane
Subject Re: [GENERAL] Empty arrays with ARRAY[]
Date
Msg-id 2922.1196111058@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[]
List pgsql-hackers
"Brendan Jurd" <direvus@gmail.com> writes:
> This approach is making sense to me, but I've run into a bit of a
> dependency issue.  A_Const does indeed have a slot for typecasts by
> way of a TypeName member.  A_Const and TypeName are both defined in
> parsenodes.h, whereas ArrayExpr is defined in primnodes.h.  So
> unfortunately I can't just add a TypeName member to ArrayExpr.

That would be quite the wrong thing to do anyway, since ArrayExpr is
a run-time representation and shouldn't have any such thing attached
to it.  What you probably need is a separate parse-time representation
of ARRAY[], a la the difference between A_Const and Const.

Another possibility is to just hack up a private communication path
between transformExpr and transformArrayExpr, ie when you see TypeCast
check to see if its argument is ArrayExpr and do something different.
This would be a mite klugy but it'd be a much smaller patch that way.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Dave Page"
Date:
Subject: Re: Locating sharedir in PostgreSQL on Windows
Next
From: Tom Lane
Date:
Subject: Re: Locating sharedir in PostgreSQL on Windows