Adding support for a fully qualified column-name in UPDATE ... SET

From: Jim Finnerty <jfinnert(at)amazon(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Adding support for a fully qualified column-name in UPDATE ... SET
Date: 2018-12-07 17:04:48
Message-ID: 1544202288966-0.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-12-07 17:05:38 Re: additional foreign key test coverage
Previous Message Sergei Kornilov 2018-12-07 16:40:51 Re: [HACKERS] REINDEX CONCURRENTLY 2.0