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

From Pavel Stehule
Subject Re: string_to_array with an empty input string
Date
Msg-id AANLkTine_q0e2KcEQ4PkaAvtKJxcVF1JWZEk3FfJocKY@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
> Really?
>
> FOR var IN SELECT UNNEST(arr) LOOP ... END LOOP
>
> I mean, doing everything is sort of clunky in PL/pgsql, but this
> doesn't seem particularly bad as PL/pgsql idioms go.
>

this simple construction can take much more memory than other. I
proposed two or three years ago FOREACH statement

FOREACH var IN array LOOP END LOOP

this statement can be implemented very efective - and I think it can
be joined to some form of string_to_array function, because var
specify target element type.

FOREACH var IN parse('....',...) LOOP END LOOP

Regards

Pavel Stehule


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: review: psql: edit function, show function commands patch
Next
From: Dimitri Fontaine
Date:
Subject: Re: string_to_array with an empty input string