Plurrrr

Wed 19 Oct 2022

A Look at Postgres 15: MERGE Command with Examples

With PostgreSQL 15 comes a new SQL Command called MERGE. MERGE has been in the SQL standard for quite a while, but it just made its way into the PostgreSQL codebase. Prior to MERGE, if you wanted to refresh a target table from a source table, prior to Postgres 15, you could use the "upsert" method with the ON CONFLICT clause.

Now, MERGE can be used instead! Some situations where MERGE makes a lot of sense are:

  • data loading from external sources, thru foreign data wrappers
  • staged and batched process jobs

Source: A Look at Postgres 15: MERGE Command with Examples, an article by Jean-Paul Argudo.

Tree search in Haskell

The interesting part of this program is the breadth-first tree traversal, and the tree traversal part now has only two arguments instead of three; the filter operation afterwards is trivial. Tree search in Haskell is mostly tree, and hardly any search!

Source: Tree search in Haskell, an article by Mark Dominus.