From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Can we go beyond the standard to make Postgres radically better?
Date: Sun, 13 Feb 2022 09:29:14 +0100
Message-ID: <20220213082914.zet7f5ojb4z2laov@hjp.at> (raw)
In-Reply-To: <3a50f4fb-3b62-cd5c-a60c-a7211c7f7a5e@pgug.de>
References: <7117322c-185c-4283-990d-6646d8476409@Spark>
<F04BD036-073C-42AD-B308-43D21C75024B@gmail.com>
<20220210172229.4it7ioddvrtmws37@hjp.at>
<eafc22b5-703d-2993-b4bc-4edad404f63f@pgug.de>
<20220212195057.amvpuhytkkcndyhh@hjp.at>
<ade50b0c-a69e-3d8d-3f70-52363fff24ae@pgug.de>
<20220212213453.tordj3445pgyxonq@hjp.at>
<3a50f4fb-3b62-cd5c-a60c-a7211c7f7a5e@pgug.de>
On 2022-02-13 01:11:16 +0100, Andreas 'ads' Scherbaum wrote:
> On 12/02/2022 22:34, Peter J. Holzer wrote:
> > On 2022-02-12 22:09:25 +0100, Andreas 'ads' Scherbaum wrote:
> > > On 12/02/2022 20:50, Peter J. Holzer wrote:
> > > > On 2022-02-12 01:18:04 +0100, Andreas 'ads' Scherbaum wrote:
> > > > > On 10/02/2022 18:22, Peter J. Holzer wrote:
> > > > > > On 2022-02-09 21:14:39 -0800, Guyren Howe wrote:
> > > > > > > Examples of small things Postgres could have:
> > > > > > >
> > > > > > > • SELECT * - b.a_id from a natural join b
> > [...]
> > > > > Maybe for this specific use case it's easier to teach psql how to do that,
> > [...]
> > > > I think the easiest way to get the columns would be to EXPLAIN(verbose)
> > > > the query. Otherwise psql (or whatever your shell is) would have to
> > > > completely parse the SQL statement to find the columns.
[...]
> > > I was thinking about this problem for a while, and it's not easy to solve.
> > > Hence I came up with the idea that psql could - once the table is known
> > > and very specific psql syntax is there (\- as example) replace the * with
> > > the actual columns. All of this before the query is run, and as a user you
> > > can edit the column list further.
> > Yeah, but the problem is that it isn't that easy for psql to figure out
> > which table is involved.
>
> The complaint is not about complex queries, or CTEs, or Joins. This is
> about simple queries where a user wants to discover - surf - the database
> and look into specific tables, but exclude certain columns.
If you look back through this thread you will notice that it was me who
brought up that specific scenario. You might trust me to know what I was
thinking about when I wrote it ;-).
> More specifically, this is when the user types in interactive queries.
I do write quite complex queries interactively. Even when "surfing",
joins are common because in a normalized schema many columns just
contain meaningless foreign keys. But I also do some data analysis
interactively (which is where CTEs usually come in) and I like to
develop queries interactively before putting them into (Python) programs.
But even if I didn't do that - if you add a feature like that to psql,
it should work for all queries, not just a tiny subset.
> Today psql tries to do autocomplete for certain scenarios, this too does
> not work in complex queries, but nevertheless is a useful help if someone
> tries to run simple, interactive queries.
Autocomplete doesn't even work well for simple queries. It's better than
nothing, but I don't think that it should serve as a model for new
features.
hp
--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: hjp-pgsql@hjp.at
Subject: Re: Can we go beyond the standard to make Postgres radically better?
In-Reply-To: <20220213082914.zet7f5ojb4z2laov@hjp.at>
References: <7117322c-185c-4283-990d-6646d8476409@Spark> <F04BD036-073C-42AD-B308-43D21C75024B@gmail.com> <20220210172229.4it7ioddvrtmws37@hjp.at> <eafc22b5-703d-2993-b4bc-4edad404f63f@pgug.de> <20220212195057.amvpuhytkkcndyhh@hjp.at> <ade50b0c-a69e-3d8d-3f70-52363fff24ae@pgug.de> <20220212213453.tordj3445pgyxonq@hjp.at> <3a50f4fb-3b62-cd5c-a60c-a7211c7f7a5e@pgug.de> <20220213082914.zet7f5ojb4z2laov@hjp.at>
* 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