Re: INSERT ON DUPLICATE KEY UPDATE

Поиск
Список
Период
Сортировка
От Robert Treat
Тема Re: INSERT ON DUPLICATE KEY UPDATE
Дата
Msg-id 1087594165.2111.74.camel@camel
обсуждение исходный текст
Ответ на Re: INSERT ON DUPLICATE KEY UPDATE  (Eduardo Pérez Ureta <eperez@it.uc3m.es>)
Список pgsql-general
Compare the syntaxes of the two commands. IMHO the my$ql syntax is
friendlier and I would have probably preferred that it had become the
standard. (I'll leave open the possibility that my$ql's syntax would
fall apart in complex scenarios that only db2/oracle/pg are capable of)

As to your second question, no, postgresql will not accept this command,
and no one has current plans to implement it, though it is on the TODO
list so don't be afraid to submit a patch for it yourself (or hire
someone to write the patch for you), chances are good it would be
accepted. If you can bang it out in the next 2 weeks you could even get
it into 7.5 :-)

On your third note, I believe that my$ql does lock the table in order to
accomplish this, not sure about db2/oracle.

Robert Treat

On Fri, 2004-06-18 at 16:46, Eduardo Pérez Ureta wrote:
> On 2004-06-18 20:15:11 UTC, Robert Treat wrote:
> > IIRC the standard syntax is based on db2's horrendous merge on command,
> > which was only added to the standard a couple months back.
>
> Great! I didn't know that was standard.
> I see that Oracle has it:
> http://www.dba-oracle.com/oracle_tips_rittman_merge.htm
> And db2 as you said:
> http://www.databasejournal.com/features/db2/article.php/3322041
>
> Could you explain why db2's merge command is horrendous?
> Is it better the mysql command?
>
> So will postgresql accept this command?
>
> > IIRC the main downside to the select/update method is it introduces a
> > race condition that can only be solved by locking the table; not an
> > issue for most my$ql apps but would be frowned upon by most postgresql
> > users.
>
> Or course, if you don't need to do locking is a plus.
>
> Eduardo
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


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

Предыдущее
От: George Essig
Дата:
Сообщение: Re: putting binary data in a char field?
Следующее
От: Robert Treat
Дата:
Сообщение: Re: INSERT ON DUPLICATE KEY UPDATE