Re: SQL INSERT Statement -- Multi-Row Insert
От | Bruno Wolff III |
---|---|
Тема | Re: SQL INSERT Statement -- Multi-Row Insert |
Дата | |
Msg-id | 20030614141117.GA28264@wolff.to обсуждение исходный текст |
Ответ на | SQL INSERT Statement -- Multi-Row Insert (Alan Searles <alien@attglobal.net>) |
Ответы |
Re: SQL INSERT Statement -- Multi-Row Insert
Re: SQL INSERT Statement -- Multi-Row Insert |
Список | pgsql-novice |
On Sat, Jun 14, 2003 at 09:52:26 -0400, Alan Searles <alien@attglobal.net> wrote: > Is PostgreSQL able to perform multi-row inserts using a single INSERT > statement as shown below ? > > INSERT INTO table ( col1, col2, col3 ) > VALUES ( value1, value2, value3 ), > ( value4, value5, value6 ), > ( value7, value8, value9 ) > > Yes, I have looked through the PostgreSQL documentation, and it DOES > NOT appear as though it can. > I was hoping that I did not read it right. This was recently covered on one of the postgres lists. For small (I am not sure how long query strings can be, but small is at least hundreds of values.) numbers of values you can use union. For example: INSERT INTO table ( col1, col2, col3 ) select value1, value2, value3 union select value4, value5, value6 union select value7, value8, value9;
В списке pgsql-novice по дате отправления: