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

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: Can we go beyond the standard to make Postgres radically better?
Дата
Msg-id 20220212195057.amvpuhytkkcndyhh@hjp.at
обсуждение исходный текст
Ответ на Re: Can we go beyond the standard to make Postgres radically better?  (Andreas 'ads' Scherbaum <ads@pgug.de>)
Ответы Re: Can we go beyond the standard to make Postgres radically better?  (Andreas 'ads' Scherbaum <ads@pgug.de>)
Re: Can we go beyond the standard to make Postgres radically better?  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Список pgsql-general
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
> >
> > 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).
>
> Maybe for this specific use case it's easier to teach psql how to do that,
> instead of trying to amend the SQL implementation? Example:
>
> SELECT * \- col1 \- col2 FROM table
>
> psql looks up the columns, translates * into the actual list minus these two
> columns and lets you continue entering the query.

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.)

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Bryn Llewellyn
Дата:
Сообщение: Re: "grant usage on schema" confers the ability to execute all user-defined functions in that schema, with needing to grant "execute"
Следующее
От: Mladen Gogala
Дата:
Сообщение: Babelfish for PostgreSQL