Re: MERGE Specification - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: MERGE Specification
Date
Msg-id 4811D7DD.9070100@dunslane.net
Whole thread Raw
In response to Re: MERGE Specification  (Robert Treat <xzilla@users.sourceforge.net>)
List 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


pgsql-hackers by date:

Previous
From: Aidan Van Dyk
Date:
Subject: Re: Proposed patch - psql wraps at window width
Next
From: Alvaro Herrera
Date:
Subject: Re: MERGE Specification