Re: Array behavior oddities - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Array behavior oddities
Date
Msg-id 24814.1200414847@sss.pgh.pa.us
Whole thread Raw
In response to Re: Array behavior oddities  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> Here's something else which confused me just now. Why does the second query
> return NULL instead of an array slice?

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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Gavin Sherry
Date:
Subject: Re: Declarative partitioning grammar
Next
From: Tom Lane
Date:
Subject: Re: Declarative partitioning grammar