Re: string_to_array with an empty input string

From: Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Greg Stark <gsstark(at)mit(dot)edu>, Thom Brown <thom(at)linux(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: string_to_array with an empty input string
Date: 2010-08-11 23:42:15
Message-ID: AANLkTim+s9HP-ef4o58ToOVMrxBTAY966ykR4cam+Heg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11 August 2010 21:52, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)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(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2010-08-11 23:47:37 Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)
Previous Message Andrew Dunstan 2010-08-11 23:39:37 Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)