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

From Brendan Jurd
Subject Re: [GENERAL] Empty arrays with ARRAY[]
Date
Msg-id 37ed240d0711261242p29404abbw1bcd68efe5b6d29b@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] Empty arrays with ARRAY[]  ("Brendan Jurd" <direvus@gmail.com>)
Responses Re: [GENERAL] Empty arrays with ARRAY[]  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Quoting Tom, from the previous thread linked by Martijn:

> It could be pretty ugly, because type assignment normally proceeds
> bottom-up :-(.  What you might have to do is make the raw grammar
> representation of ARRAY[] work like A_Const does, ie, there's a
> slot to plug in a typecast.  That's pretty much vestigial now for
> A_Const, if memory serves, but it'd be needful if ARRAY[] has to
> be able to "see" the typecast that would otherwise be above it in
> the parse tree.

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.

I'm new to this area of the codebase (and parsers generally), so I'm
treading carefully.  What would be the best way to resolve this?
Would moving TypeName into primnodes.h be acceptable?

Thanks for your time,
BJ


pgsql-hackers by date:

Previous
From: Bernd Helmle
Date:
Subject: Re: maintenance_work_mem memory constraint?
Next
From: "Dave Page"
Date:
Subject: Re: Locating sharedir in PostgreSQL on Windows