Re: [GENERAL] Empty arrays with ARRAY[]

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Brendan Jurd" <direvus(at)gmail(dot)com>
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-27 17:19:51
Message-ID: 23298.1196183991@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

"Brendan Jurd" <direvus(at)gmail(dot)com> writes:
> Now I'm thinking I leave the grammar rules alone (apart from making it
> legal to specify an empty list of elements), and instead push the
> typename down into the child node from makeTypeCast(), if the child is
> an A_ArrayExpr. Does that work better?

Actually, if you do that you might as well forego the separate node type
(which requires a nontrivial amount of infrastructure). I think it
would work just about as well to have transformExpr check whether the
argument of a TypeCast is an ArrayExpr, and if so call
transformArrayExpr directly from there, passing the TypeName as an
additional argument. Kinda ugly, but not really any worse than the way
A_Const is handled in that same routine. (In fact, we could use the
same technique to get rid of the typename field in A_Const ... might
be worth doing?)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Erik Jones 2007-11-27 17:23:06 Re: Why LIMIT and OFFSET are commutative
Previous Message Scott Marlowe 2007-11-27 17:19:01 Re: System Load analyze

Browse pgsql-hackers by date

  From Date Subject
Next Message Usama Munir 2007-11-27 17:29:48 Re: String encoding during connection "handshake"
Previous Message mac_man2005 2007-11-27 16:49:36 Re: Replacement Selection

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-11-27 19:14:19 Re: pg_regress: stat correct paths
Previous Message Simon Riggs 2007-11-27 16:38:09 Re: Proposed patch for operator lookup caching