FROM clause in UPDATE - Mailing list pgsql-novice

From Slavisa Garic
Subject FROM clause in UPDATE
Date
Msg-id bcb558900607170907l5d840189tc3ec2c68619fcb91@mail.gmail.com
Whole thread Raw
Responses Re: FROM clause in UPDATE
List pgsql-novice
Hi all,

Could someone tell me why this doesn't work in PostgreSQL 8.1.3 where it works in v8.0.5 and earlier (i haven't tried versions between these two):

v8.1.3
--------------------------------------------------
-bash-3.00$ psql -c "UPDATE NimrodGridRun
                        SET status = 'active', control = 'start'
                        WHERE status not in ('active', 'jsuspend')
                        AND NimrodGridRun.compute_id = 1
                        AND NimrodGridRun.agent_id = NimrodAgent.agent_id
                        AND NimrodAgent.status = 'active'
                        AND NimrodAgent.tag = '1'"
ERROR:  missing FROM-clause entry for table "nimrodagent"
-bash-3.00$

=================================
v8.0.5
----------------------------------------------
[slavisa: talvath - ~ (0)]: psql -c "UPDATE NimrodGridRun
                        SET status = 'active', control = 'start'
                        WHERE status not in ('active', 'jsuspend')
                        AND NimrodGridRun.compute_id = 1
                        AND NimrodGridRun.agent_id = NimrodAgent.agent_id
                        AND NimrodAgent.status = 'active'
                        AND NimrodAgent.tag = '1'"
UPDATE 0



The first query will work if I insert "FROM nimrodagent" just before the WHERE clause,
Regards,
Slavisa

pgsql-novice by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: RE : How do I compile/test a PL/SQL in Postgresql
Next
From: Alan Hodgson
Date:
Subject: Re: FROM clause in UPDATE