Return Upserted Data

There was an interesting issue recently opened. The user made several interesting decisions that to my view can be useful for all (click to see):

  • Spatial types. Not only Postgres has a rich GIS/Spatial support, the driver offers dedicated types, to make the experience as smooth as possible.
  • Batch insert with ON_CONFLICT clause - making the insertion pipeline very efficient.
  • RETURNING clause. Since the ON_CONFLICT clause's action is DO_NOTHING, the clause will return all the INSERTed rows. I believe that it filters out a substantial part of objects, so it effectively reduces the amount of work that needs to be performed with the output (instead of the entire set).

Comments

Popular posts from this blog

Hierarchical Query in SQL with C# and Entity Framework Core

Efficient Data Modification With Entity Framework Core

SQL: SELECT DISTINCT on Some Columns