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 1nID9R-00078P-4y for pgsql-general@arkaria.postgresql.org; Thu, 10 Feb 2022 17:22:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nID9Q-0003tf-1s for pgsql-general@arkaria.postgresql.org; Thu, 10 Feb 2022 17:22:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nID9P-0003tW-Nx for pgsql-general@lists.postgresql.org; Thu, 10 Feb 2022 17:22:35 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nID9L-0005bv-8z for pgsql-general@lists.postgresql.org; Thu, 10 Feb 2022 17:22:35 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id DCB755B7B; Thu, 10 Feb 2022 18:22:29 +0100 (CET) Date: Thu, 10 Feb 2022 18:22:29 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Can we go beyond the standard to make Postgres radically better? Message-ID: <20220210172229.4it7ioddvrtmws37@hjp.at> Mail-Followup-To: pgsql-general@lists.postgresql.org References: <7117322c-185c-4283-990d-6646d8476409@Spark> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lod3zvwffrjbci3v" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --lod3zvwffrjbci3v Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2022-02-09 21:14:39 -0800, Guyren Howe wrote: > Postgres has since the outset gone beyond the SQL standard in many ways : > types, inheritance, programmability, generality are all well beyond what = SQL > used to mandate and still well beyond the current standard. >=20 > There are huge developer benefits available to focusing more on making a = great > relational programming environment, well outside the SQL standard. >=20 > Examples of small things Postgres could have: >=20 > =E2=80=A2 SELECT * - b.a_id from a natural join b > =E2=96=A1 let me describe a select list by removing fields from a r= elation. In > the example, I get all fields in the join of a and b other than= the > shared key, which I only get once. Natural join already does this. My use case for such a feature are tables which contain one column (or a small number of columns) which you usually don't want to select: A bytea column or a very wide text column. In a program I don't mind (in fact I prefer) listing all the columns explicitely, but exploring a database interactively with psql typing lots of column names is tedious (especially since autocomplete doesn't work here). > =E2=96=A1 note how this simplifies maintaining views wrt changes i= n tables Maybe. I'm not sure whether views that change automatically with their underlying tables wouldn't do more harm than good. > =E2=80=A2 Let me put the FROM clause first > =E2=96=A1 if I can write FROM a join b SELECT a.height, a.name, b.e= mail then an > editor can give me autocomplete when I=E2=80=99m writing the sele= ct clause. Logically from should be first and select should be last, I agree. That would make life easier for editors, but it shouldn't be impossible for an editor to look forward. > =E2=80=A2 Hierarchical schemas I thought I would miss that when I learned SQL 25 years ago, but in practice I didn't. Plus it's already not always obvious how names are resolved and hierarchical schemas would almost certainly make that worse. > Examples of larger things Postgres might have: >=20 > =E2=80=A2 First-class functions. I prefer to have as much application logic as feasible in the application, so I'm rather indifferent to server-side programming features. > =E2=80=A2 Other languages > =E2=96=A1 Tutorial D, Datalog, Quell, let=E2=80=99s open this puppy= up! > =E2=96=A1 SQL is a terrible, no good, very bad language I suspect that lots of the internals (especially in the optimizer) are quite specific to how SQL works. So it's probably not that easy to provide a different query language - at least not one which works efficiently. But you are welcome to try. > =E2=80=A2 A portable, low-level API > =E2=96=A1 An alternative to SQLite that provides CRUD operations on= a Postgres > database. I'm not familiar with the low level SQLite interface. I've only ever used it with SQL. I did use dBase back in the 1980s, though ;-). Are you really interested in a lower-level interface or do you just want it in-process? I suspect that just adding in-process capability would require a major overhaul. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --lod3zvwffrjbci3v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmIFSc4ACgkQ8g5IURL+ KF10xQ//T+n3neurL66XY6Sd1b+kpXuCdTO5mRIATi27CXOu8hxIL2rvyj71rBah fuM0q/lGDcx2ZYKImL8lRvu6A4Qs8U9xhnUG5bt/IZcie0JJSaGqoygudF1imHvK VPKJsw3WIrhWmU4Dmp1tAaGe4IlgdoDeiPYPTUoJ2472uwbktYrVP5NC5Q2YbDAM lL0f7tE1IHNrwkJtePIwtWQtuvcQmNDwiMYsa/GnLPrfTKMRDdcEw7RPbxNxrpKI qiP9/BpqQBXjB/WLEPPwiOIdmd/a1zntNnSPqUorp2q5HmhHiJ+XrOaNYoEcS4zC e2HvGMC2lBscs4TFS2D6XpWrrGpDM9XIeKb7Azvi/tqIlUHEaeCX05gc2XOy9Tsk Vo4wbDnLL1WQOA9mAHkLo6ixsioUPlyLY+2vCge8QNsRaO/svq6mrZwEJ0GRci1l yIHgAzNA1hY5U7yeCOgS8ENHBaDZCqZM7fpgHs6K8g+7gB4qL+vj64nq7XGEx6rf NQ0gjflX3BEJYmAsAAfcxp6yAU0QyyszQlxD9dsi6g0H5Gn0kUSw4v9Sorcv9wee pkFaUtNB+JIG0D4tnL72nEtuE0stGKw2VsZE76zUvSU/iYLV3MhVxVlw1Xu8Mz/4 Ob7K4R6bys/b0+CK5E8U/2m4OBIs4QPi9kRqvXiOmJAyY8QFBFk= =Ulu6 -----END PGP SIGNATURE----- --lod3zvwffrjbci3v--