2026年8月21日(金) 23:27 Fujii Masao <[email protected]>:
>
> On Fri, Aug 21, 2026 at 7:06 PM Ian Lawrence Barwick <[email protected]> 
> wrote:
> > Revised patch attached.
>
> Thanks for updating the patch!
>
> I was initially thinking this patch should be backpatched to v16, where
> commit bcedd8f appeared. However, since an AS clause is optional even
> in v14 and v15, while the table alias itself is required there, should
> "an AS clause" in the original description be changed to "a table alias"
> for v14 and v15 as well?

Good point! Patch attached for v14/v15.

> +   clause, a table alias is optional.  Assigning alias names to the columns
> +   of the <command>VALUES</command> list is optional, but is good practice.
>
> In queries.sgml, writing a table alias is also described as good
> practice according to the SQL standard. So we could mention here that
> writing a table alias is good practice as well. But, since this is
> already covered in queries.sgml and it seems a bit overkill to repeat
> it here, I'm fine with mentioning only assigning alias names to the
> columns as good practice.

Yes, I think we can keep it simple here, the main objective is to correct
the inaccuracy, not write an SQL style guide ;).


Regards

Ian Barwick
From fe63616cd98e4d2e5d8df77391793a8fe7504626 Mon Sep 17 00:00:00 2001
From: Ian Barwick <[email protected]>
Date: Fri, 28 Aug 2026 14:58:14 +0900
Subject: [PATCH v1] doc: clarify VALUES usage in FROM clause (Pg14/Pg15)

"AS" is optional from PostgreSQL 14, so reword the description to
use "table alias" instead.
---
 doc/src/sgml/ref/values.sgml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/ref/values.sgml b/doc/src/sgml/ref/values.sgml
index 4bf7bfdffee..8b42524c7dc 100644
--- a/doc/src/sgml/ref/values.sgml
+++ b/doc/src/sgml/ref/values.sgml
@@ -198,10 +198,10 @@ UPDATE employees SET salary = salary * v.increase
   WHERE employees.depno = v.depno AND employees.sales &gt;= v.target;
 </programlisting>
 
-   Note that an <literal>AS</literal> clause is required when <command>VALUES</command>
-   is used in a <literal>FROM</literal> clause, just as is true for
-   <command>SELECT</command>.  It is not required that the <literal>AS</literal> clause
-   specify names for all the columns, but it's good practice to do so.
+   Note that a table alias is required when <command>VALUES</command> is used in
+   a <literal>FROM</literal> clause, just as is true for <command>SELECT</command>.
+   It is not required that the table alias specify names for all the columns, but it's
+   good practice to do so.
    (The default column names for <command>VALUES</command> are <literal>column1</literal>,
    <literal>column2</literal>, etc. in <productname>PostgreSQL</productname>, but
    these names might be different in other database systems.)
-- 
2.43.0

Reply via email to