Re: [PATCH] doc: clarify AS requirement when VALUES used in a FROM clause

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Ian Lawrence Barwick <barwick(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] doc: clarify AS requirement when VALUES used in a FROM clause
Date: 2026-07-24 09:51:33
Message-ID: 42d07567402f6264431bde8912da3ede369d342c.camel@cybertec.at
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 2026-07-24 at 18:12 +0900, Ian Lawrence Barwick wrote:
> the VALUES documentation [*] still claims an AS clause is required
> when VALUES is
> used in a FROM clause. This has not been the case since PostgreSQL 16
> (commit bcedd8f).
>
> [*] https://www.postgresql.org/docs/current/sql-values.html
>
> Attached patch reworks the offending sentence from:
>
> > Note that an AS clause is required when VALUES is used in a FROM clause, just
> > as is true for SELECT. It is not required that the AS clause specify names for
> > all the columns, but it's good practice to do so.
>
> to:
>
> > If VALUES is used in a FROM clause, it's not necessary to have an AS clause
> > specifying names for each column, but it's good practice to do so.

This should be changed, but I think the wording could be better:

Note that if <command>VALUES</command> is used in a <literal>FROM</literal>
clause, it is not necessary to specify an <literal>AS</literal> clause, but
it is good practice to do so.

Otherwise people might think that you need to specify an AS clause, but
you can omit specifying the column names in the AS clause.

Yours,
Laurenz Albe

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2026-07-24 10:06:48 Re: ri_Fast* crash w/ nullable UNIQUE constraint
Previous Message Ian Lawrence Barwick 2026-07-24 09:12:42 [PATCH] doc: clarify AS requirement when VALUES used in a FROM clause