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

Re: BUG #3876: Problems migrating databases

From: "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
To: "Ruben Camargo Gomez" <rubencamargogomez(at)hotmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3876: Problems migrating databases
Date: 2008-01-15 22:05:11
Message-ID: 1d4e0c10801151405p1c35146fn4cea4ec881545044@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
On Jan 15, 2008 5:52 PM, Ruben Camargo Gomez
<rubencamargogomez(at)hotmail(dot)com> wrote:
> I had this error from my log file:
> ERRORROR:  missing FROM-clause entry for table "tbldishot"
> CONTEXT:  SQL statement "update tblalohot set  alohot_con =
> coalesce(alohot_con,0)+8 where tbldishot.dishot_cod = tblalohot.dishot_cod
> and tbldishot.establ_cod = 8699 and tbldishot.tiphah_cod=7 and
> tblalohot.establ_cod = 7713 and tbldishot.dishot_fec >= '2007-10-23' and
> tbldishot.dishot_fec < '2007-10-24'"
>         PL/pgSQL function "fun_reg_dis" line 34 at

Prior to 8.1, PostgreSQL adds tables missing in the FROM clause
automatically. This behaviour has been removed because it could lead
to unexpected results.

You should fix your query by using the UPDATE FROM syntax and by
having tbldishot in the FROM clause. You have several enlightening
examples in http://www.postgresql.org/docs/8.1/static/sql-update.html
.

You can also use add_missing_from = on in your postgresql.conf if you
really can't fix your query but it's not recommended.

--
Guillaume

In response to

pgsql-bugs by date

Next:From: David WheelerDate: 2008-01-16 00:28:04
Subject: BUG #3879: OS X Start Script should not `cd /Users/postgres`
Previous:From: Esquivel, Maria Jose (Merrill Lynch Service Desk)Date: 2008-01-15 21:37:58
Subject: Information

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