HelpOverFlow
HelpOverFlow

Reputation: 335

INSERT action ON CONFLICT on a postgres table with a hash UNIQUE SHA256 geom

I have a PostGIS table with a Unique Index geom column.

CREATE UNIQUE INDEX IF NOT EXISTS idx_uniquegeometry_geom ON environment.fires(SHA256(ST_Normalize(geom)));"""

I am trying adding an "ON CONFLICT" action while inserting data to the table environment.fires as mentioned by @Kadir Şahbaz in here as shown below:

ON CONFLICT ON CONSTRAINT UNIQUE INDEX idx_uniquegeometry_geom DO NOTHING; 

But PostgreSQL does not acknowledge the WITH on ON CONFLICT action. Could anyone point out the correct way to add this ON CONFLICT action?

Upvotes: -1

Views: 188

Answers (1)

HelpOverFlow
HelpOverFlow

Reputation: 335

 ON CONFLICT (SHA256(ST_Normalize(geom))) DO NOTHING;

Upvotes: 0

Related Questions