Adding support for a fully qualified column-name in UPDATE ... SET - Mailing list pgsql-hackers

From Jim Finnerty
Subject Adding support for a fully qualified column-name in UPDATE ... SET
Date
Msg-id 1544202288966-0.post@n3.nabble.com
Whole thread Raw
Responses Re: Adding support for a fully qualified column-name in UPDATE ... SET  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
The accepted syntax for UPDATE ... SET does not currently permit the column
name to be qualified by schema.table or table or correlation-name, as is
permitted in other systems.  This is apparently due to the syntax that
PostgreSQL accepts for composite columns, which would create an ambiguity in
the grammar if both SET t.c [ opt_indirection ] = value, or SET c.f [
opt_indirection ] = value, were both allowed.

As a result, databases migrated from several other commercial database
servers to PostgreSQL must be "cleaned up" to reconcile these differences.
This can be time consuming and unnecessary.

This can be disambiguated during semantic analysis in all but the most
contrived cases.

The current behavior has been documented as follows:

column_name

    The name of a column in the table named by table_name. The column name
can be qualified with a subfield name or array subscript, if needed. Do not
include the table's name in the specification of a target column — for
example, UPDATE table_name SET table_name.col = 1 is invalid.

If the community is willing to extend this behavior to support optional
schema-name . table-name, table-name, or correlation-name, we can discuss
solutions in this thread.

thank you,

    /Jim





-----
Jim Finnerty, AWS, Amazon Aurora PostgreSQL
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html


pgsql-hackers by date:

Previous
From: Sergei Kornilov
Date:
Subject: Re: [HACKERS] REINDEX CONCURRENTLY 2.0
Next
From: Alvaro Herrera
Date:
Subject: Re: additional foreign key test coverage