RE: Re: REPLACE INTO table a la mySQL

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема RE: Re: REPLACE INTO table a la mySQL
Дата
Msg-id ECEHIKNFIMMECLEBJFIGOEOHCAAA.chriskl@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: REPLACE INTO table a la mySQL  (mlw <markw@mohawksoft.com>)
Список pgsql-hackers
> > I know we're not in the business of copying mySQL,
> > but the REPLACE INTO table (...) values (...) could be
> > a useful semantic.  This is a combination INSERT or
> > UPDATE statement.  For one thing, it is atomic, and
> > easier to work with at the application level.  Also
> > if the application doesn't care about previous values,
> > then execution has fewer locking issues and race
> > conditions.
>
> I don't know if it is standard SQL, but it will save hundreds of
> lines of code
> in applications everywhere. I LOVE the idea. I just finished
> writing a database
> merge/update program which could have been made much easier to
> write with this
> syntax.

The reason MySQL probably has it though is because it doesn't support proper
transactions.

While we're at it, why not support the MySQL alternate INSERT syntax
(rehetorical):

INSERT INTO table SET field1='value1', field2='value2';

...

Chris



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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: RE: Imperfect solutions
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: RE: Imperfect solutions