Re: Plsql Function with error: No space left on device. - Mailing list pgsql-sql

From Tom Lane
Subject Re: Plsql Function with error: No space left on device.
Date
Msg-id 3122.993567296@sss.pgh.pa.us
Whole thread Raw
In response to Re: Plsql Function with error: No space left on device.  ("David M. Richter" <D.Richter@DKFZ-heidelberg.de>)
List pgsql-sql
"David M. Richter" <D.Richter@DKFZ-heidelberg.de> writes:
> The query works, but not right.(apart from the timeaspect)
> UPDATE image SET  seriesoid = r.parentoid
> FROM image i JOIN relseries_image000 r ON i.chilioid=r.childoid;

You shouldn't mention "image i" in the FROM clause --- since image is
already implicitly part of the FROM list, you are getting a self-join,
and an unconstrained one at that.

Try just

UPDATE image SET  seriesoid = r.parentoid
FROM relseries_image000 r WHERE image.chilioid = r.childoid;
        regards, tom lane


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: loosing connection after function call
Next
From: Jason Earl
Date:
Subject: Re: Changing datatype of a column