Is it possible to achieve Upsert
in Postgres without using the On Conflict
clause?
I have a requirement where I converted a normal table into a partitioned table with a partition key that was not part of the Primary Key
when the table was non-partitioned.
Since the partition key is added to the primary key column list now, my Upsert
statements are failing as the On Conflict
clause is missing the partition key. But as per the requirement, I cannot add the partition key to the On Conflict
clause as I will have more than one row for the previous primary key column combination in the partitioned table.
Hence, I want Upsert
to be achieved without the On Conflict
clause. Can someone suggest what alternatives would work.