News for hackers. Stuff that matters.
Re:Everything that makes working with databases easier by btilly on Tuesday May 31, 2022 @10:39AM (#31570030)
When you're trying to run general purpose code inside of the database, you're beyond what it is good for. I've written a compiler in PL/pgSQL (for a special purpose language for time series data) and agree that there is a limit to what you want to do there.

SQL is a query tool. Not a general purpose programming platform. But it is good for surprisingly complex queries on surprisingly large and complex data sets.

Re:Everything that makes working with databases easier by FreakLegion on Tuesday May 31, 2022 @10:03PM (#31577228)
We're really just debating the meaning of "simple" from:

> SQL as a query language is truly horrible once you get past simple data queries.

I think things start to get dicey as soon as you're past basic SELECT, FROM, JOIN, WHERE [1], ORDER BY. CTEs, subqueries, cross joins, case expressions, etc. certainly aren't advanced, but they do surprising things at times, and it can be hard to tell what's going on under the hood with the optimizer. I'd prefer to work with a full-fledged programming language or the underlying primitives the optimizer translates SQL into, but SQL isn't a problem for me personally. The problem is that I've had teammates be utterly defeated by it.

1. And even then you can get in trouble, e.g. not knowing that OR short-circuiting isn't part of the standard, and Postgres for example doesn't do it.

Re:Everything that makes working with databases easier by btilly on Wednesday June 01, 2022 @09:22AM (#31581442)
I think we can agree on that resolution. :-)