pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David M. Richter <D.Richter@DKFZ-heidelberg.de>
Cc: Richard Huxton <dev@archonet.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Plsql Function with error: No space left on device.
Date: Tue, 26 Jun 2001 10:54:56 -0400
Message-ID: <3122.993567296@sss.pgh.pa.us> (raw)
In-Reply-To: <3B388D05.C3919F0F@DKFZ-heidelberg.de>
References: <3B36FB6E.1039F0D4@DKFZ-heidelberg.de>
	<005601c0fd60$db576740$1001a8c0@archonet.com>
	<3B388D05.C3919F0F@DKFZ-heidelberg.de>

"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



view thread (9+ messages)  latest in thread

Message-ID: <3122.993567296@sss.pgh.pa.us>
Permalink:  ../3122.993567296@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3122.993567296@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, D.Richter@DKFZ-heidelberg.de, dev@archonet.com
  Subject: Re: Plsql Function with error: No space left on device.
  In-Reply-To: <3122.993567296@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox