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

From Brendan Jurd
Subject Re: [GENERAL] Empty arrays with ARRAY[]
Date
Msg-id 37ed240d0711261431j3c36c13bn519b0a4d70a41343@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] Empty arrays with ARRAY[]  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [GENERAL] Empty arrays with ARRAY[]
List pgsql-hackers
On Nov 27, 2007 8:04 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Brendan Jurd" <direvus@gmail.com> writes:
> > ... 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.
>

Ah.  I wasn't aware of the distinction; I started by looking in gram.y
and saw that the ARRAY parse path creates an ArrayExpr node, whilst
the constant parse paths create A_Const nodes.  I didn't realise that
ArrayExpr was "skipping ahead" and creating the same kind of object
that the transform produces.

Glad I stopped and asked for directions then. =)

I'm not 100% clear on what the A_ prefix signifies ... is A_ArrayExpr
a good name for the parse-time structure?

Thanks for your time,
BJ


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Locating sharedir in PostgreSQL on Windows
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] Empty arrays with ARRAY[]