Re: funny view/temp table problem with query

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
Cc: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>, PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: funny view/temp table problem with query
Date: 2009-02-27 11:57:40
Message-ID: 873ae0t7m3.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl> writes:

> On Feb 26, 2009, at 11:02 AM, Grzegorz Jaśkiewicz wrote:
>
>> looks like you completely misunderstood my question.
>
> I'm not surprised. What do you expect with random capitalisation, random table
> alias names and random indentation combined with queries getting wrapped by
> the mailing-list software?

Uh, we get a lot of really mangled SQL and explain plans -- I don't see
anything wrong with these. If the question was unclear it sounds like it's
just because it's a fairly subtle problem and was hard to describe. Needing
two cracks at describing the problem is pretty much par for the course here.

I haven't tested the query to see what's going on but if the problem is due to
random() then in 8.4 you could use WITH to guarantee that the subquery is
executed precisely once and the results reused as-is subsequently.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's PostGIS support!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Tassonis 2009-02-27 12:30:59 Standalone ODBC Driver
Previous Message Linos 2009-02-27 11:51:03 Re: function to return rows as columns?