Re: [HACKERS] MERGE SQL Statement for PG11
| От | Simon Riggs |
|---|---|
| Тема | Re: [HACKERS] MERGE SQL Statement for PG11 |
| Дата | |
| Msg-id | CANP8+jK3e=bHM0sWwcHKCaMOyubt3nMv9Mgxxgvkff1smOp7ZA@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: [HACKERS] MERGE SQL Statement for PG11 (Peter Geoghegan <pg@bowt.ie>) |
| Список | pgsql-hackers |
On 1 February 2018 at 19:39, Peter Geoghegan <pg@bowt.ie> wrote: > Finally, I noticed a problem with your new EXPLAIN ANALYZE instrumentation: > > Is it 4 rows inserted, or 0 inserted? > > postgres=# merge into testoids a using (select i "key", 'foo' "data" > from generate_series(0,3) i) b on a.key = b.key when matched and 1=0 > then update set data = b.data when not matched then insert (key, data) > values (b.key, 'foo'); > MERGE 0 Got it. I'm reporting the number of rows processed instead of the number of rows inserted. My test happened to have those values set equal. Minor bug, thanks for spotting. -- Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления: