Re: Strange result with "SELECT ... ORDER BY random() LIMIT 1" and JOINs

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: Etienne Dube <etdube(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Strange result with "SELECT ... ORDER BY random() LIMIT 1" and JOINs
Date: 2013-08-15 21:20:11
Message-ID: 520D460B.3030305@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/15/2013 11:46 AM, Etienne Dube wrote:
> Hello,

>
> I don't really understand what is going on there, the result appears
> incorrect to me. The following page seems to offer some explanations as
> to what is happening:
> http://sql-info.de/postgresql/postgres-gotchas.html#1_6 . Indeed, adding
> OFFSET 0 to the "s" subquery solves the issue.
>
> Can somebody shed some light on this topic? Is this behaviour correct or
> should it be considered a bug?

See here for explanation:

http://www.postgresql.org/message-id/8569.1128439517@sss.pgh.pa.us

>
> Thanks!
> Etienne
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vik Fearing 2013-08-15 21:49:32 Re: Escape string for LIKE op
Previous Message Janek Sendrowski 2013-08-15 20:51:35 devide and summarize sql result (all)