Re: Why the "UPDATE tab SET tab.col" is invalid?
От | Geoff Winkless |
---|---|
Тема | Re: Why the "UPDATE tab SET tab.col" is invalid? |
Дата | |
Msg-id | CAEzk6ffXhvYhJ-51vNuLUZ5Dv57igqwz6GCxFNXj6wFfvZFmPQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Why the "UPDATE tab SET tab.col" is invalid? (Merlin Moncure <mmoncure@gmail.com>) |
Ответы |
Re: Why the "UPDATE tab SET tab.col" is invalid?
|
Список | pgsql-hackers |
On 7 April 2016 at 14:48, Merlin Moncure <mmoncure@gmail.com> wrote: > > On Thu, Apr 7, 2016 at 4:39 AM, postgres_sure <postgres_sure@163.com> wrote: > > Hi, > > > > I found "Do not include the table's name in the specification of a target > > column > > — for example, UPDATE tab SET tab.col = 1 is invalid." in > > the documentation. > > > > Some people usually like to update table by alias. They want to add this > > feature. > > Is this syntax described in the SQL standard? Given that the SQL standard has no concept of UPDATEs against a query with multiple tables, and that's where this could bring the most clarity, I'm not sure that it's reasonable to object on that basis. As far as I can see the SQL standard doesn't let you alias tables in an UPDATE (for the same reason, I imagine) but we allow _that_ even in a single-table UPDATE. <update statement: positioned> ::= UPDATE <table name> SET <set clause list> WHERECURRENT OF <cursor name> Geoff
В списке pgsql-hackers по дате отправления: