BUG #2849: Erroronous UPDATE syntax in documentation

Lists: pgsql-bugs
From: "Gurjeet Singh" <singh(dot)gurjeet(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2849: Erroronous UPDATE syntax in documentation
Date: 2006-12-21 11:43:44
Message-ID: 200612211143.kBLBhieV000970@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2849
Logged by: Gurjeet Singh
Email address: singh(dot)gurjeet(at)gmail(dot)com
PostgreSQL version: 8.2.0
Operating system: Windows
Description: Erroronous UPDATE syntax in documentation
Details:

The documentation at

http://www.postgresql.org/docs/8.2/interactive/rules-views.html#AEN38727

illustrates the examples using wrong syntax of UPDATE command. The FROM
clause is missing; if the FROM clause and the appropriate table is added to
the query, it works fine.

Sample session:

postgres=# create table t1( a int, b int );
CREATE TABLE
postgres=# create table t2( a int, b int );
CREATE TABLE
postgres=# update t1 set b = t2.b where t1.a = t2.a;
ERROR: missing FROM-clause entry for table "t2"
LINE 1: update t1 set b = t2.b where t1.a = t2.a;
^
postgres=# update t1 set b = t2.b from t2 where t1.a = t2.a;
UPDATE 0
postgres=#


From: "Gurjeet Singh" <singh(dot)gurjeet(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2849: Erroronous UPDATE syntax in documentation
Date: 2006-12-21 12:08:07
Message-ID: 65937bea0612210408l7ecedf20m537368f48803647d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

On 12/21/06, Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com> wrote:
>
>
> The following bug has been logged online:
>
> Bug reference: 2849
> Logged by: Gurjeet Singh
> Email address: singh(dot)gurjeet(at)gmail(dot)com
> PostgreSQL version: 8.2.0
> Operating system: Windows
> Description: Erroronous UPDATE syntax in documentation

*** Erroneous ***

--
gurjeet[(dot)singh](at)EnterpriseDB(dot)com
singh(dot)gurjeet(at){ gmail | hotmail | yahoo }.com


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Gurjeet Singh" <singh(dot)gurjeet(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2849: Erroronous UPDATE syntax in documentation
Date: 2006-12-27 16:08:45
Message-ID: 17835.1167235725@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"Gurjeet Singh" <singh(dot)gurjeet(at)gmail(dot)com> writes:
> http://www.postgresql.org/docs/8.2/interactive/rules-views.html#AEN38727
> illustrates the examples using wrong syntax of UPDATE command. The FROM
> clause is missing; if the FROM clause and the appropriate table is added to
> the query, it works fine.

Well, it used to be right ;-) ... but yeah, now that add_missing_from
defaults to off we should adjust the examples. Done, thanks for the
report.

regards, tom lane