Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nINyj-0006II-96 for pgsql-general@arkaria.postgresql.org; Fri, 11 Feb 2022 04:56:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nINyi-0007mr-5P for pgsql-general@arkaria.postgresql.org; Fri, 11 Feb 2022 04:56:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nINyh-0007mh-KB for pgsql-general@lists.postgresql.org; Fri, 11 Feb 2022 04:56:15 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nINye-0001fy-Lb for pgsql-general@lists.postgresql.org; Fri, 11 Feb 2022 04:56:14 +0000 Received: by mail-pj1-x1032.google.com with SMTP id qe15so7076494pjb.3 for ; Thu, 10 Feb 2022 20:56:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=SVbhQWZpryxE8vIJG0KGwLvtftLjW9d6ef9iAX0VWto=; b=oReKyzqwcEkfK3r3grMBTqOMw5z3qp1HXSkZ6H4s2o56XMI/i/B3aN80jxQntmgDAe 61KosX9NbW5ZYufDwH6S7cA5i3zNNd+LVl/DDTrbQI7pa5JvCv7ul95MhcXZSAD/z+YK r+pimbFyfpqs5FnIe51DRpI85tLhf0cV2KL55gIWKJgOp1hWDUF526xCQ4XRwJnIyzcw NaEDgUtTyeNZMXfjKZsQ+s+vs6bNDM1ZGDy072yo/oncFfTAvj/gRNXrI8dMm6s+3jT0 /NogPdlygzonbA3E01k9FyyWGvwCRDZf+p22Dq9Ug/uyT3x9CR/ou+xz0neMvAK7NgE8 xEkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=SVbhQWZpryxE8vIJG0KGwLvtftLjW9d6ef9iAX0VWto=; b=48amWcT6JOH8c1GA/ALfwI6qeJ7+9uqz2O/QUmbN9ZSWziPU3xkde5Y0TzT3uMCsqe Dg1rZ/Oa0Ri7rctM9ROOc/zzsECJv6qDrWjUijRgq/Jcu9a/50XL1+Nc134a1MfS+H+z byvOPLHDGimTlPy70h4iIs56eYB0Lz1E6leupEnTHGH0pHdYAcsymzkLk+MN1mMyIy00 hhueyrr0kdKmNKpkoujuPAO7OiDalLcxQYgmBxI+zBYXLLWa5mWhVKPNJku6d2nsXSF1 VCRARN2wOsMkOF80xk7moPYLwccoyhEFp3YBiJdYcly7ihyfKpN+RFs9GK+5eHlZB/Ab moTQ== X-Gm-Message-State: AOAM5335mzToazFuLzObi+2VZbY4okR2u6NzffhKFGkwVAeuJr8Xxle/ eiyAmy5sa1zwTKPeEf8SL5t2H+MNVQt+VQ== X-Google-Smtp-Source: ABdhPJxv9E2QWlWEWspw/ANleVNEdTSNslXlFprULrs9uCDc+aP6xZs57lNeBpEs7ni7WKgjN7xBJQ== X-Received: by 2002:a17:90b:3b46:: with SMTP id ot6mr871959pjb.179.1644555371344; Thu, 10 Feb 2022 20:56:11 -0800 (PST) Received: from smtpclient.apple ([2600:8801:8800:2::f]) by smtp.gmail.com with ESMTPSA id q32sm18935216pgm.26.2022.02.10.20.56.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Feb 2022 20:56:10 -0800 (PST) Content-Type: multipart/alternative; boundary="Apple-Mail=_6C96A037-2048-403E-993D-37A3B04DB0A2" Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\)) Subject: Re: Can we go beyond the standard to make Postgres radically better? From: Guyren Howe In-Reply-To: <1d76a9dc-1260-fea5-86ee-b6ba7bad2927@gmail.com> Date: Thu, 10 Feb 2022 20:56:06 -0800 Cc: "pgsql-general@lists.postgresql.org" X-Mailbutler-Message-Id: 6D4F9253-9898-4D49-8F90-DED476001555 Message-Id: References: <7117322c-185c-4283-990d-6646d8476409@Spark> <20220210172229.4it7ioddvrtmws37@hjp.at> <20220210172545.f7vtdcrg325v3xlx@hjp.at> <937E9BA7-F8D9-4547-A171-AC1497470A0C@gmail.com> <1d76a9dc-1260-fea5-86ee-b6ba7bad2927@gmail.com> To: Mladen Gogala X-Mailer: Apple Mail (2.3693.60.0.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_6C96A037-2048-403E-993D-37A3B04DB0A2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On Feb 10, 2022, at 17:06 , Mladen Gogala = wrote: >=20 >> But SQL is a terrible, no good, very bad language. >=20 > I cannot accept such a religious persecution of SQL without a detailed = explanation. >=20 I feel like anyone who is defending SQL here isn=E2=80=99t aware of how = much better the alternatives are, and how bad SQL really is. I mean: it=E2=80=99s hard to write, hard to read. It=E2=80=99s hard to = generate. But that=E2=80=99s just the starting point. One of the worst things about it that I don=E2=80=99t see much discussed = is that it imposes assumptions about the storage model that aren=E2=80=99t= part of the relational model. Like heavyweight, hard to change tables = with transactional guarantees and such. Don=E2=80=99t get me wrong, = those things are great to have available, but I don=E2=80=99t 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=E2=80=99t 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=E2=80=99t 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=E2=80=99s because = they=E2=80=99re 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=E2=80=99t want to learn SQL and who can = blame them? Another issue: everyone thinks =E2=80=9Crelational=E2=80=9D is the same = thing as =E2=80=9CSQL=E2=80=9D. 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. --Apple-Mail=_6C96A037-2048-403E-993D-37A3B04DB0A2 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 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=E2=80=99= t aware of how much better the alternatives are, and how bad SQL really = is.

I mean: it=E2=80=99= s hard to write, hard to read. It=E2=80=99s hard to generate. But = that=E2=80=99s just the starting point.

One of the worst things about it that I = don=E2=80=99t see much discussed is that it imposes assumptions about = the storage model that aren=E2=80=99t part of the relational model. Like = heavyweight, hard to change tables with transactional guarantees and = such. Don=E2=80=99t get me wrong, those things are great to have = available, but I don=E2=80=99t 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=E2=80=99t 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=E2=80=99t 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=E2=80=99s because they=E2=80=99re 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=E2=80=99= t want to learn SQL and who can blame them?

Another issue: everyone thinks = =E2=80=9Crelational=E2=80=9D is the same thing as =E2=80=9CSQL=E2=80=9D. = 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.
3D""= --Apple-Mail=_6C96A037-2048-403E-993D-37A3B04DB0A2--