1

I am developing a mechanism that uploads records to CartoDB - first by importing the records to a new table, and then insert the records from the new table to an existing table.

The problem is that the existing table may already contain some of the records (each record has a unique record_id) - in this case I would like to override the existing values with the values of the new record.

This could be done in two steps, by deleting the existing records (whose record_id is in the new table) and then insert all the records from the new table.

The SQL MERGE command should allow to do that in a single command. Is this command supported by CartoDB? Can you give an example with the exact the syntax? (I am getting a 'Syntax error at or near "MERGE"').

1

1 Answer 1

1

According to this, MERGE is not implemented in PostgreSQL 9.3.4, the version that CartoDB runs on. You can check the version by running SELECT version() in the SQL editor in your account.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.