Re: [GENERAL] Empty arrays with ARRAY[]

From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [GENERAL] Empty arrays with ARRAY[]
Date: 2007-11-26 20:42:21
Message-ID: 37ed240d0711261242p29404abbw1bcd68efe5b6d29b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-11-26 21:04:18 Re: [GENERAL] Empty arrays with ARRAY[]
Previous Message Erik Jones 2007-11-26 20:39:13 Re: replication in Postgres

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2007-11-26 20:45:03 Re: Locating sharedir in PostgreSQL on Windows
Previous Message Bernd Helmle 2007-11-26 20:41:33 Re: maintenance_work_mem memory constraint?

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-11-26 21:04:18 Re: [GENERAL] Empty arrays with ARRAY[]
Previous Message Jorgen Austvik 2007-11-26 17:48:52 Re: pg_regress: stat correct paths