Skip site navigation (1) Skip section navigation (2)

FROM clause in UPDATE

From: "Slavisa Garic" <sgaric(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: FROM clause in UPDATE
Date: 2006-07-17 16:07:25
Message-ID: bcb558900607170907l5d840189tc3ec2c68619fcb91@mail.gmail.com (view raw or flat)
Thread:
Lists: 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

Responses

pgsql-novice by date

Next:From: Alan HodgsonDate: 2006-07-17 16:33:40
Subject: Re: FROM clause in UPDATE
Previous:From: Richard Broersma JrDate: 2006-07-17 12:17:07
Subject: Re: RE : How do I compile/test a PL/SQL in Postgresql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group