MERGE ... WHEN NOT MATCHED BY SOURCE

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема MERGE ... WHEN NOT MATCHED BY SOURCE
Дата
Msg-id CAEZATCWqnKGc57Y_JanUBHQXNKcXd7r=0R4NEZUVwP+syRkWbA@mail.gmail.com
обсуждение исходный текст
Ответы Re: MERGE ... WHEN NOT MATCHED BY SOURCE  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
This allows MERGE to UPDATE or DELETE target rows where there is no
matching source row. In addition, it allows the existing "WHEN NOT
MATCHED" syntax to include an optional "BY TARGET" to make its meaning
more explicit. E.g.,

MERGE INTO tgt USING src ON ...
  WHEN NOT MATCHED BY SOURCE THEN UPDATE/DELETE ...
  WHEN NOT MATCHED BY TARGET THEN INSERT ...

AFAIK, this is not part of the standard (though I only have a very old
draft copy). It is supported by at least 2 other major DB vendors
though, and I think it usefully rounds off the set of possible MERGE
actions.

Attached is a WIP patch. I haven't updated the docs yet, and there are
probably a few other things to tidy up and test, but the basic
functionality is there.

Regards,
Dean

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: split TOAST support out of postgres.h
Следующее
От: Joseph Koshakow
Дата:
Сообщение: Re: Infinite Interval