Re: Can we go beyond the standard to make Postgres radically better?

From: Andreas 'ads' Scherbaum <ads(at)pgug(dot)de>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Can we go beyond the standard to make Postgres radically better?
Date: 2022-02-13 00:11:16
Message-ID: 3a50f4fb-3b62-cd5c-a60c-a7211c7f7a5e@pgug.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.
>>>
>>> (On a tangent, I'm wondering if this could work for autocomplete. The
>>> problem with autocomplete is of course that you probably don't have
>>> a syntactically correct query at the time you need it. So the editor
>>> would have to patch that up before sending it to the database.)
>> 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. More
specifically,
this is when the user types in interactive queries.

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.

Same can be true for the reserve situation where someone wants to exclude
specific columns, basically expanding * to a column list.

Regards,

--
Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mladen Gogala 2022-02-13 01:12:02 Re: Can we go beyond the standard to make Postgres radically better?
Previous Message Andrus 2022-02-12 22:04:13 How to split normal and overtime hours