pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mladen Gogala <gogala.mladen@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Can we go beyond the standard to make Postgres radically better?
Date: Thu, 10 Feb 2022 20:06:56 -0500
Message-ID: <1d76a9dc-1260-fea5-86ee-b6ba7bad2927@gmail.com> (raw)
In-Reply-To: <937E9BA7-F8D9-4547-A171-AC1497470A0C@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>

Please, don't top-post.

On 2/10/22 17:51, Guyren Howe wrote:
> When you dig into it, the powerful idea here is the relational 
> algebra, and its equivalence to a first-orderish logic.
>
> I put up with SQL so I can use relations, and I love Postgres because 
> it has the least bad SQL (by a mile!)

As you've said, the basic motivation behind SQL is the relational 
algebra from the branch of mathematics called "naive set theory". SQL 
does that really well. Late Dr. Ted Codd was a mathematician, so he was 
also aware of non-naive set theory so the "selection language" of 
Zermelo's axiom of choice was also included. That is why we are 
selecting elements of subsets and not defining subsets. Codd was also 
working for IBM, once great company, whose name stands for "It's Better 
Manually". IBM was doing lots of business with the banks (figures) so 
the transaction handling part was modeled after the banking business. 
When I've had my first course in SQL, back in 1988, I was given analogy 
with writing checks: I A writes a $100 check to B, one of the following 
two things can happen: either A has enough money to cover the check, in 
which case B will have $100 more in his account and A will have $100 
less or, if the transaction doesn't go through, nothing will happen. Any 
mixed outcome in which B is $100 richer but A doesn't have $100 less 
money in his account or A has $100 less money but B is not $100 richer 
is strictly prohibited. That transaction must happen atomically, as a 
whole or not happen at all. So, that's SQL for you: relational algebra 
plus banking business. Relational algebra implementation is rather good, 
although a tad too verbose. Transactional part is excellent and still 
reflects the needs of the business community today.


>
> But SQL is a terrible, no good, very bad language.


I cannot accept such a religious persecution of SQL without a detailed 
explanation.


>
> I don’t really understand why folks who love the relational model 
> aren’t perpetually up in arms about SQL being their only option. Much 
> better query languages are known and well studied.
>
> https://www.scattered-thoughts.net/writing/against-sql
>
> I’d love to see Postgres offer say Datalog. But until that Halcyon 
> day, we could at least aggressively extend SQL to make it less awful.

It will take much more than a blog post to eradicate decades of 
investment into SQL by both computer scientists and business community. 
I've seen the same crusade against SQL on Slashdot and I assume you were 
behind that as well. So, if I were you, I would establish a company to 
implement Datalog language in a database and try to sell that to the 
people. That happened in 1979: Larry Ellison, Bob Miner and Ed Oates 
established a company and offered a SQL product, competing with 
hierarchical databases like IMS and CICS/DL1, to the world. The rest is 
history. I am sure that if you do the same and if you are right about 
the Datalog, a brilliant future is ahead of you. That is the way of the 
Force. Anything can happen. A young student can come from Africa, 
convinced that he can sell electric cars and be very successful while 
doing that. So successful that he became the richest man in the world. I 
am sure that your endeavor with Datalog will have similar success. 
Market decides what is the standard. May the Force be with you. In the 
mean time, I will still be using SQL.

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

view thread (50+ messages)  latest in thread

Message-ID: <1d76a9dc-1260-fea5-86ee-b6ba7bad2927@gmail.com>
Permalink:  ../1d76a9dc-1260-fea5-86ee-b6ba7bad2927@gmail.com/
Also on:    postgresql.org/message-id/1d76a9dc-1260-fea5-86ee-b6ba7bad2927@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: gogala.mladen@gmail.com
  Subject: Re: Can we go beyond the standard to make Postgres radically better?
  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>

* 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