pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guyren Howe <guyren@gmail.com>
To: Mladen Gogala <gogala.mladen@gmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Can we go beyond the standard to make Postgres radically better?
Date: Thu, 10 Feb 2022 20:56:06 -0800
Message-ID: <DD28AF26-F6AF-4082-BA1F-7C802465C5E0@gmail.com> (raw)
In-Reply-To: <1d76a9dc-1260-fea5-86ee-b6ba7bad2927@gmail.com>
References: <7117322c-185c-4283-990d-6646d8476409@Spark>
	<F04BD036-073C-42AD-B308-43D21C75024B@gmail.com>
	<20220210172229.4it7ioddvrtmws37@hjp.at>
	<20220210172545.f7vtdcrg325v3xlx@hjp.at>
	<YgV//dHwtGVDADUp@momjian.us>
	<CAD+mzowO=ZfgeNi7HwYGbNtTCQ--JyvaYLiiBwrPdXcLPeZ3aQ@mail.gmail.com>
	<937E9BA7-F8D9-4547-A171-AC1497470A0C@gmail.com>
	<1d76a9dc-1260-fea5-86ee-b6ba7bad2927@gmail.com>

On Feb 10, 2022, at 17:06 , Mladen Gogala <gogala.mladen@gmail.com> wrote:
> 
>> But SQL is a terrible, no good, very bad language.
> 
> I cannot accept such a religious persecution of SQL without a detailed explanation.
> 

I feel like anyone who is defending SQL here isn’t aware of how much better the alternatives are, and how bad SQL really is.

I mean: it’s hard to write, hard to read. It’s hard to generate. But that’s just the starting point.

One of the worst things about it that I don’t see much discussed is that it imposes assumptions about the storage model that aren’t part of the relational model. Like heavyweight, hard to change tables with transactional guarantees and such. Don’t get me wrong, those things are great to have available, but I don’t need them all the time.

The whole NoSQL movement has been such a tragedy. Having diagnosed a problem with SQL databases, they threw out the relational model and very often reimplemented a form of SQL when they should have done the opposite. There is no reason you can’t have a relational database with an on-demand schema, with eventual consistency, with all those fun things that various NoSQL databases provide. Those storage models have their place, but the SQL standard says you can’t use them.

But the biggest issue is the verbose, terrible, very bad query language. In the web development community where I spend my time, it is almost holy writ to treat the database as a dumb data bucket, and do everything in the application layer (even things like validations, even when that is a provably incorrect approach). Why? I think it’s because they’re used to working in a pleasant language like Ruby or Python, and they want to do everything there. And who can blame them?

But this is bad. Proper relational design can take over much (most!) of the design of a typical business app, with significant efficiency gains the result. But no *community* is going to choose that when most of the members of the community don’t want to learn SQL and who can blame them?

Another issue: everyone thinks “relational” is the same thing as “SQL”. If we could get folks to break that association, then relations should be a standard feature of high-level programming languages, just as arrays and hashes are.

Heck, give me a functional programming language with a good relational model, and I can implement OOP in that relational language without breaking a sweat.

Software *should* be designed around a logical/relational layer with minimal occasional forays into Turing completeness where necessary. But no-one is even thinking about software like that because relational is SQL and SQL is awful.

view thread (50+ messages)  latest in thread

Message-ID: <DD28AF26-F6AF-4082-BA1F-7C802465C5E0@gmail.com>
Permalink:  ../DD28AF26-F6AF-4082-BA1F-7C802465C5E0@gmail.com/
Also on:    postgresql.org/message-id/DD28AF26-F6AF-4082-BA1F-7C802465C5E0@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: guyren@gmail.com, gogala.mladen@gmail.com
  Subject: Re: Can we go beyond the standard to make Postgres radically better?
  In-Reply-To: <DD28AF26-F6AF-4082-BA1F-7C802465C5E0@gmail.com>
  References: <7117322c-185c-4283-990d-6646d8476409@Spark> <F04BD036-073C-42AD-B308-43D21C75024B@gmail.com> <20220210172229.4it7ioddvrtmws37@hjp.at> <20220210172545.f7vtdcrg325v3xlx@hjp.at> <YgV//dHwtGVDADUp@momjian.us> <CAD+mzowO=ZfgeNi7HwYGbNtTCQ--JyvaYLiiBwrPdXcLPeZ3aQ@mail.gmail.com> <937E9BA7-F8D9-4547-A171-AC1497470A0C@gmail.com> <1d76a9dc-1260-fea5-86ee-b6ba7bad2927@gmail.com> <DD28AF26-F6AF-4082-BA1F-7C802465C5E0@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox