Re: trouble selecting from array

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: brian <brian(at)zijn-digital(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: trouble selecting from array
Date: 2008-03-28 18:55:03
Message-ID: b42b73150803281155u44fa8cb7x31e6974d07a2775e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Mar 28, 2008 at 2:19 PM, Merlin Moncure <mmoncure(at)gmail(dot)com> wrote:
> reading the archives, you wrote:
> "Because it isn't a slice expression --- you used colon nowhere, so the
> result type is going to be text not text[]. (Remember that the parser
> must determine the expression's result type at parse time, so whether
> there are enough subscripts can't enter into this.) Our alternatives
> here are to throw a subscripting error or return NULL. I'd personally
> have gone with throwing an error, I think, but it seems far too late to
> revisit that decision."
>
> is there not enough information available to the parser to reduce the
> expression dimensions by one?

ugh, I think I see the problem. You have some function that returns
an int[], which does not have a defined number of dimensions, so:

select func()[] is not known to return an int or an int[] at parse
time, so the path of least resistance was to assume 'int'. sorry for
the noise.

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2008-03-28 19:05:15 Re: dunction issue
Previous Message Alex Adriaanse 2008-03-28 18:38:57 Out of memory