Re: MERGE Specification

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Decibel!" <decibel(at)decibel(dot)org>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Gregory Stark <stark(at)enterprisedb(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, "A(dot)M(dot)" <agentm(at)themactionfaction(dot)com>
Subject: Re: MERGE Specification
Date: 2008-04-25 13:08:45
Message-ID: 4811D7DD.9070100@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Treat wrote:
>
> Perhaps a better option would be to implement Merge per spec, and then
> implement a "replace into" command for the oltp scenario. This way you keep
> the spec behavior for the spec syntax, and have a clearly non-spec command
> for non-spec behavior.
>

MySQL's "REPLACE INTO" is *NOT* semantically equivalent to any flavor of
"insert or update". It is "delete plus insert". They do have "INSERT ...
ON DUPLICATE KEY UPDATE ..."

Presumably, if we implement MERGE with transaction-safe semantics, which
Simon has agreed to do, we would not need to consider anything like the
latter, but we might still want to consider REPLACE INTO (in the MySQL
sense).

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2008-04-25 13:10:57 Re: MERGE Specification
Previous Message Aidan Van Dyk 2008-04-25 13:04:50 Re: Proposed patch - psql wraps at window width