Top "Upsert" questions

For issues relating to performing upsert (combination update/insert) operations.

How do I force an INSERT into a table with a unique key if it's already in the table?

I have a table: CREATE TABLE Students (studentId TEXT PRIMARY KEY, name TEXT); I want to insert records into the …

mysql insert-update upsert
Add or replace entity in Azure Table Storage

I'm working with Windows Azure Table Storage and have a simple requirement: add a new row, overwriting any existing row …

azure upsert azure-table-storage
Find or insert based on unique key with Hibernate

I'm trying to write a method that will return a Hibernate object based on a unique but non-primary key. If …

java hibernate unique-constraint upsert unique-key
bulk upserts within a sql transaction in golang

I've been messing around with golang's sql package with transactions, and I'm trying to understand how to do bulk upserts …

sql transactions go bulkinsert upsert
MongoDB: upsert sub-document

I have documents that looks something like that, with a unique index on bars.name: { name: 'foo', bars: [ { name: 'qux', …

mongodb mongodb-query upsert
AddOrUpdate works not as expected and produces duplicates

I'm using Code-First DBContext-based EF5 setup. In DbMigrationsConfiguration.Seed I'm trying to fill DB with default dummy data. To accomplish …

c# entity-framework entity-framework-5 upsert
How to include excluded rows in RETURNING from INSERT ... ON CONFLICT

I've got this table (generated by Django): CREATE TABLE feeds_person ( id serial PRIMARY KEY, created timestamp with time zone …

sql django postgresql upsert sql-returning
What is USING in SQL Server 2008 MERGE syntax?

Jacob asked the perfect question: give me the MERGE syntax. Every answer out there immediately jumps to the most complicated …

sql-server merge sql-server-2008-r2 upsert
Updating the path 'x' would create a conflict at 'x'

This error happens when I tried to update upsert item: Updating the path 'x' would create a conflict at 'x'

mongodb upsert
postgres syntax error at or near "ON"

I created this table: CREATE TABLE IF NOT EXISTS config_activity_log ( id serial primary key, activity_name varchar(100) NOT …

sql postgresql upsert