Re: [GENERAL] Empty arrays with ARRAY[]

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

On Nov 27, 2007 8:04 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Brendan Jurd" <direvus(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-11-26 22:34:03 Re: [GENERAL] Empty arrays with ARRAY[]
Previous Message Tom Hart 2007-11-26 22:30:42 speed up insert query

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-11-26 22:34:03 Re: [GENERAL] Empty arrays with ARRAY[]
Previous Message Tom Lane 2007-11-26 22:30:17 Re: Locating sharedir in PostgreSQL on Windows

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-11-26 22:34:03 Re: [GENERAL] Empty arrays with ARRAY[]
Previous Message Tom Lane 2007-11-26 21:48:42 Proposed patch to fix plpgsql's handling of block labels