Re: string_to_array with an empty input string - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: string_to_array with an empty input string
Date
Msg-id AANLkTim+s9HP-ef4o58ToOVMrxBTAY966ykR4cam+Heg@mail.gmail.com
Whole thread Raw
In response to Re: string_to_array with an empty input string  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 11 August 2010 21:52, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Peter Geoghegan <peter.geoghegan86@gmail.com> writes:
>> What's wrong with something like array_is_empty(anyarray) returns
>> boolean?
>
> What's that got to do with iterating over an array?

Only that I'm of the opinion that we'd be well served by more array
convenience functions, including convenience functions like the
proposed array_is_empty(), and, perhaps, functions that exist for the
express purpose of iterating over arrays more tersely in plpgsql.


> We could certainly
> provide it if it were commonly useful, but I'm not convinced of that.

Fair enough. I agree that it isn't *commonly* useful. I just don't
think that we're disadvantaged by being more inclusive, while still
bringing benefits to a minority of applications and users.


On 11 August 2010 23:06, Robert Haas <robertmhaas@gmail.com> wrote:
>> Iterating over an array is a simple thing. We should make simple things easy.
>
> I definitely agree that PL/pgsql could be more usable.  Or if not,
> then some other PL with a better overall design could be more usable.
> I am not entirely sure how to create such a thing, however.

Nor am I. However, I think that richer array manipulation facilities
are low-hanging fruit.

--
Regards,
Peter Geoghegan


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)
Next
From: Bruce Momjian
Date:
Subject: Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)