Re: Missing array support - Mailing list pgsql-hackers

From Joe Conway
Subject Re: Missing array support
Date
Msg-id 3F00EEC1.8080408@joeconway.com
Whole thread Raw
In response to Re: Missing array support  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Missing array support  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
> 
>>So array[] should produce '{}' of (an array) type determined by the 
>>context? OK -- seems easy enough.
> 
> Is it?  I think we'd decided that this could only reasonably be handled
> by creating a datatype representing array-of-UNKNOWN.  I'm afraid to do
> that because I think it might allow the parser's type resolution
> algorithms to follow paths we will not like.  Perhaps it can be made to
> work, but I think it will require some careful study.

I took a closer look -- yeah, without array-of-UNKNOWN I don't think we 
can make this work.

I got something working by forcing the element type to UNKNOWN when the 
elements list is empty in transformExpr(), but then select_common_type() 
turns around and turns UNKNOWN into TEXT, so you wind up with an empty 
text[].

I won't bother sending that patch in because I *know* it will get 
rejected ;-)

I guess we should put array-of-UNKNOWN on the list of things to look at 
for 7.5.

Joe



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: INDEX_MAX_KEYS to 64?
Next
From: Joe Conway
Date:
Subject: Re: Missing array support