Question : My understanding of ambiguous fields, or where I see the error elsewhere, is when I’ve defined a JOIN […]
Tag: upsert
Call UPSERT function multiple times to different inputs
Question : I have a function: merge_vehicles(vid, cid, vname, reg_no, name, name_1st) Can i call it multiple times on inputs […]
Upserting 50K records into big table (app. 350 columns) in postgresql
Question : Using C# I’m trying to upsert from csv file (~ 55000 records) to a postgresql table with 350 […]
Set values conditionally in Postgres UPSERT
Question : We have an UPSERT feature achieved through on conflict do set. How can I set the values conditionally […]
TEMP table alternatives for pl/pgsql
Question : I am trying to emulate MERGE behavior with pl/pgsql: — Generate the data from funtion CREATE TEMP TABLE […]
Lock a row if it exists, create new record otherwise
Question : I have a table that holds metadata for “documents”, let’s call it DOCS. Other tables point to the […]
How do I update and insert specific set of rows to an existing table using Merge in SQL Server 2008 R2?
Question : I have a table in the database that I need to update based on the records being passed […]
UPSERT with UPDATE on variable column gives error “command cannot affect row a second time”
Question : Hey I’m trying to insert or update(if the constraints are duplicated) based on a query result, these are […]
UPSERT statement never completes, infinite loop?
Question : Based on some of the stackoverflow answers I wrote the following UPSERT statement, which I think must be […]
SQL UPSERT in Postgres
Question : I have the following SQL: UPDATE table_name as t set value = c.value from (values(10, ‘key_1’, 60),(11, ‘key_2’, […]