Re: Generating table rows from arrays

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Generating table rows from arrays
Дата
Msg-id 487F20DB.6030106@archonet.com
обсуждение исходный текст
Ответ на Generating table rows from arrays  (Florian Weimer <fweimer@bfk.de>)
Ответы Re: Generating table rows from arrays
Список pgsql-sql
Florian Weimer wrote:
> Is there a convenient way to turn an array into table rows?  For
> example, I've got an array like {1, 2, 3} and would like to insert
> rows:
> 
>   ('aaa', 1)
>   ('aaa', 2)
>   ('aaa', 3)
> 
> The first row is constant.  I could write a loop with PL/pgsql, I
> guess, but I wonder if there are better options nowadays.

The smallest function I've seen is Merlin Moncure's here:

http://people.planetpostgresql.org/merlin/index.php?/archives/4-fun-with-arrays.html


--   Richard Huxton  Archonet Ltd


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

Предыдущее
От: Florian Weimer
Дата:
Сообщение: Generating table rows from arrays
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: Generating table rows from arrays