Hello, Anyone here with upsert experience?
I'm trying to run this query: WITH UPSERT AS (UPDATE oltp.ST_TRANSACTION SET (row1, row2, row3) = (ET.row1, ET.row2, ET.row3) FROM (SELECT * FROM loadoltp.ST_TRANSACTION_INSERT WHERE LOADTABLETIME = '2012-11-30 14:48:59.252960') AS ET returning *) INSERT INTO oltp.ST_TRANSACTION SELECT (ET.row1, ET.row2, ET.row3) FROM (SELECT * FROM loadoltp.ST_TRANSACTION_INSERT WHERE LOADTABLETIME = '2012-11-30 14:48:59.252960') AS ET WHERE ET.tick_server_id NOT IN (SELECT ET.tick_server_id FROM upsert b) AND tra_id NOT IN (SELECT ET.tra_id FROM upsert b) But I always get this error message: ERROR: column "row1" is of type integer but expression is of type record LINE 67: SELECT (ET.ROW1, Does anyone has an idea? wkr, Bert -- Bert Desmet 0477/305361