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

Re: getting the ranks out of items with SHARED

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Janning Vygen <vygen(at)gmx(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: getting the ranks out of items with SHARED
Date: 2005-07-13 13:35:55
Message-ID: 27411.1121261755@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-general
Janning Vygen <vygen(at)gmx(dot)de> writes:
> this way it works:

> CREATE TEMP TABLE ranking AS *Q*;
> EXECUTE 'UPDATE temp_gc SET gc_rank = ranking.rank 
> FROM ranking WHERE temp_gc.mg_name = ranking.mg_name;';

> and this way it doesn't:

> UPDATE temp_gc
> SET gc_rank = ranking.rank
> FROM (*Q*)
> ranking
> WHERE temp_gc.mg_name = ranking.mg_name;

It's difficult to be sure without looking at EXPLAIN output, but I would
guess that the second query is being done with a plan that involves
multiple scans of "*Q*", and that's confusing your function.

			regards, tom lane

In response to

Responses

pgsql-general by date

Next:From: Gnanavel SDate: 2005-07-13 13:42:54
Subject: Re: INSERT INTO from a SELECT query
Previous:From: Michael FuhrDate: 2005-07-13 13:23:29
Subject: Re: Strange memory behaviour with PGreset() ...

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