Need a script that bakes INSERT script from SELECT results

Поиск
Список
Период
Сортировка
От ShuA
Тема Need a script that bakes INSERT script from SELECT results
Дата
Msg-id E1LuPmk-0008aN-00.noface-inbox-ru@f4.mail.ru
обсуждение исходный текст
Ответы Re: Need a script that bakes INSERT script from SELECT results  (John DeSoi <desoi@pgedit.com>)
Список pgsql-sql
I'm a novice to PL/pgSQL, and I'm curious, how to write function, that wraps SELECT results into INSERT script. 

The functionality I need is about to replicate table data into remote DB.

I have tried dblink_build_insert(), but it requires primary key on tuple to create INSERT script from. I would prefer
filterclause to primary key, to generate either multiple inserts or one multi-row insert.
 

Could someone post an example how to LOOP through row fields to wrap them into 'VALUES(...,,)' list?

Thanks,
Olksy



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

Предыдущее
От: Mario Splivalo
Дата:
Сообщение: Re: Ordering a name list and ignoring whitespace
Следующее
От: John DeSoi
Дата:
Сообщение: Re: Need a script that bakes INSERT script from SELECT results