Re: MERGE Specification
От | Simon Riggs |
---|---|
Тема | Re: MERGE Specification |
Дата | |
Msg-id | 1209125844.4238.7.camel@ebony.site обсуждение исходный текст |
Ответ на | Re: MERGE Specification (Petr Jelinek <pjmodos@pjmodos.net>) |
Ответы |
Re: MERGE Specification
|
Список | pgsql-hackers |
On Fri, 2008-04-25 at 11:07 +0200, Petr Jelinek wrote: > Another thing is, the table on which we do SELECT (the one in USING) can > be different from target table and we can use columns from that table in > INSERT/UPDATE statement (probably one the reasons why spec says the > "SELECT" query has to be executed before any changes). How you want to > use the "INSERT first" implementation in this scenario ? IMHO you still > need to have both implementations in the end. So we probably need to > implement the standard one first and then implement our version and put > some restrictions of what can be in USING or INSERT part when using it. We do this: 1. Run using clause, then for each row 2. NOT MATCHED rules 3. MATCHED I'm now happy that we can get a spec-compliant end result by always forcing NOT MATCHED rules to occur before MATCHED rules, when we have at least one unique index. -- Simon Riggs 2ndQuadrant http://www.2ndQuadrant.com
В списке pgsql-hackers по дате отправления: