Skip site navigation (1) Skip section navigation (2)

Re: [PATCHES] [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, pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCHES] [GENERAL] Empty arrays with ARRAY[]
Date: 2008-03-20 21:47:34
Message-ID: 24773.1206049654@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackerspgsql-patches
"Brendan Jurd" <direvus(at)gmail(dot)com> writes:
> As discussed on -hackers, this patch allows the construction of an
> empty array if an explicit cast to an array type is given (as in,
> ARRAY[]::int[]).

Applied with minor fixes; mostly, ensuring that the cast action would
propagate down to sub-arrays, as in

regression=# select array[[1],[2.2]]::int[];
   array   
-----------
 {{1},{2}}
(1 row)

I was interested to realize that this fix validates the decision to
pass down the type information on-the-fly during transformExpr recursion.
It would have been a lot more painful to do it if we'd taken the A_Const
approach.

I didn't do anything about removing A_Const's typename field, but I'm
thinking that would be a good cleanup patch.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2008-03-20 22:08:02
Subject: Re: Sort Refinement
Previous:From: Sam MasonDate: 2008-03-20 21:34:00
Subject: Re: Sort Refinement

pgsql-patches by date

Next:From: Tom LaneDate: 2008-03-20 23:26:50
Subject: Re: [PATCHES] Show INHERIT in \du
Previous:From: Tom LaneDate: 2008-03-20 18:03:11
Subject: Re: [PATCHES] [GENERAL] Empty arrays with ARRAY[]

pgsql-general by date

Next:From: Colin WetherbeeDate: 2008-03-20 22:45:59
Subject: Re: [postgis-users] how many min. floating-points?
Previous:From: Magnus HaganderDate: 2008-03-20 21:36:06
Subject: Re: nntp not workiNG

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group