Generating table rows from arrays

Поиск
Список
Период
Сортировка
От Florian Weimer
Тема Generating table rows from arrays
Дата
Msg-id 82d4lcdd27.fsf@mid.bfk.de
обсуждение исходный текст
Ответы Re: Generating table rows from arrays  (Richard Huxton <dev@archonet.com>)
Re: Generating table rows from arrays  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Список pgsql-sql
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.

--
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: PERSISTANT PREPARE (another point of view)
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Generating table rows from arrays