Re: PL/Perl returning multiple rows

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: PL/Perl returning multiple rows
Дата
Msg-id 20031111192548.GC19912@dcc.uchile.cl
обсуждение исходный текст
Ответ на Re: PL/Perl returning multiple rows  (Joe Conway <mail@joeconway.com>)
Список pgsql-general
On Mon, Nov 10, 2003 at 11:01:45PM -0800, Joe Conway wrote:

> create or replace function foo(text, text, text)
> returns text[] as '
>  return "{\\"" . $_[0] . "\\",\\"" . $_[1] . "\\",\\"" . $_[2] . "\\"}";
> ' language plperl;

FWIW, this could be written more easily as

create or replace function foo(text, text, text)
returns text[] as '
    return qq/{"/ . (join qq/","/, @_) . qq/"}/;
' language plperl;

Somewhat more readable.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Ellos andaban todos desnudos como su madre los parió, y también las mujeres,
aunque no vi más que una, harto moza, y todos los que yo vi eran todos
mancebos, que ninguno vi de edad de más de XXX años" (Cristóbal Colón)

В списке pgsql-general по дате отправления:

Предыдущее
От: "mboscia"
Дата:
Сообщение: change conndeferrable in pg_constraint?
Следующее
От: Josué Maldonado
Дата:
Сообщение: update slow