"Bruce Momjian" <[EMAIL PROTECTED]> writes:

> Tom Lane wrote:
>> Why do you find that surprising?  It's either a slice or it isn't,
>> there's no halfway point.  Are you proposing to throw an error if only
>> some of the subscripts have colons?  What would be the point?
>
> What is confusing is if I see [1:3][2], I assume that is [1:3][2:2], not
>  [1:3][1:2].  By what logic does [2] mean from 1 to 2?

Here's something else which confused me just now. Why does the second query
return NULL instead of an array slice?

postgres=# select (array['{foo}'::text[],'{bar}'])[1][1];
 array 
-------
 foo
(1 row)

postgres=# select (array['{foo}'::text[],'{bar}'])[1];
 array 
-------
 
(1 row)


-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's PostGIS support!

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to