Re: variable value in array_to_string

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: variable value in array_to_string
Дата
Msg-id CAKFQuwaf8Wnpzw-d30t7Y22asNZ5fwjE2iUpvFnoyrtk7DO0_A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: variable value in array_to_string  ("Armand Pirvu (home)" <armand.pirvu@gmail.com>)
Ответы Re: variable value in array_to_string  ("Armand Pirvu (home)" <armand.pirvu@gmail.com>)
Список pgsql-general
Please don't top-post - it makes following the thread a lot harder.

On Mon, Nov 21, 2016 at 4:15 PM, Armand Pirvu (home) <armand.pirvu@gmail.com> wrote:
Played with unnest  but not much luck

If you want help you will need to show your work - ideally with examples that can execute with meaningful data on an empty database.

The follow gives the expected results:

DO $$
DECLARE
foo text[];
foo1 text;
delim text := ',';
begin
foo := ARRAY['one','two']::text[];
foo1 := array_to_string(foo, delim);
RAISE NOTICE '%', foo1;
END;
$$;

NOTICE: one,two

David J.

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

Предыдущее
От: John McKown
Дата:
Сообщение: Re: Postgresql 9.5 and Shell scripts/variables vs. C programming/defining a value to be used
Следующее
От: "Armand Pirvu (home)"
Дата:
Сообщение: Re: variable value in array_to_string