Re: Return last value in of array (PostgreSQL 7.2.1)

From: Erwin Brandstetter <Brsaz(at)gmzx(dot)at>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Return last value in of array (PostgreSQL 7.2.1)
Date: 2003-09-29 16:54:45
Message-ID: Xns9405C03DEB563BrandstetterFalterat@213.129.232.14
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

scrawford(at)pinpointresearch(dot)com (Steve Crawford) wrote in
news:200309231746(dot)13757(dot)scrawford(at)pinpointresearch(dot)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.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Lamar Owen 2003-09-29 17:59:09 Re: [ADMIN] postgres 6.2 vacuum
Previous Message Marvin Gonzalez 2003-09-29 16:47:27 Automatic BackUp Process