Hacker News new | ask | show | jobs
by ttfkam 1264 days ago
SQL standards are a weird thing. Rather than wait for a spec and then get implementers like in the browser space (for the most part), SQL vendors will solve a particular customer's problem, submit their solution to the standards body, the committee will tweak the syntax for best coherence with the existing spec, and then other implementers may emerge.

This ends up with four slightly different syntaxes and the one that matches the standard wasn't even the one that proposed the feature in the first place! It is what it is. Bottom line: "close enough" is as good as it gets in the database arena, so choose your implementation wisely and go all in.

With that out of the way:

  • Multiple vendors support RETURNING from both INSERT and UPDATE statements.

  • Upserts exist with most vendors, typically with the ON CONFLICT DO variant.

  • Most support MERGE now in the latest versions.

  • I don't know of any popular database that lacks support for INFORMATION_SCHEMA queries, so listing all tables is in fact both in the standard and supported by all popular implementations.