Re: Return last value in of array (PostgreSQL 7.2.1) - Mailing list pgsql-admin

From Erwin Brandstetter
Subject Re: Return last value in of array (PostgreSQL 7.2.1)
Date
Msg-id Xns9405C03DEB563BrandstetterFalterat@213.129.232.14
Whole thread Raw
In response to Return last value in of array (PostgreSQL 7.2.1)  (Erwin Brandstetter <Brsaz@gmzx.at>)
Responses Re: Return last value in of array (PostgreSQL 7.2.1)  (Joe Conway <mail@joeconway.com>)
List pgsql-admin
scrawford@pinpointresearch.com (Steve Crawford) wrote in
news:200309231746.13757.scrawford@pinpointresearch.com:

> IIRC I heard talk of new max and min array dimension functions in
> upcoming releases. I'm tired so there may be better or more elegant
> solutions but this one works (r is the array):
>
> r[rtrim(substring(array_dims(r), position(':' in
> array_dims(r))+1),']')::int]

This works and is an improvement to my previous version as it allows for
upper boundaries with any number of digits. Thank you!

Still the solution looks ugly and will perform likewise. PostgreSQL
urgently needs improvment on array handling. Hopefully new versions take
care of that (haven't tested 7.3+).

BTW: Have been away for some days, so my reply is late, sorry.


Regards
Erwin Brandstetter

--
no z in my mail.

pgsql-admin by date:

Previous
From: Matej Puntar
Date:
Subject: Re: ODBC Driver
Next
From: Erwin Brandstetter
Date:
Subject: Re: Return last value in of array (PostgreSQL 7.2.1)