Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux