Search Postgresql Archives

Re: Receiving many more rows than expected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vincent de Phily wrote
> On Friday 09 May 2014 06:52:33 Adrian Klaver wrote:
>> On 05/09/2014 05:36 AM, Vincent de Phily wrote:
>> > On Friday 09 May 2014 07:01:32 Tom Lane wrote:
>> >> Vincent de Phily <

> vincent.dephily@

> > writes:
>> >>> In case it changes anything, this is the uncut (but still anonimized)
>> >>> 
>> >>> function:
>> >>>      query = """UPDATE foo SET processing = 't' WHERE id IN
>> >>>      
>> >>>             (SELECT id FROM foo WHERE processing = 'f' ORDER BY id
>> ASC
>> >>>             LIMIT %d
>> >>>             
>> >>>              FOR UPDATE)
>> >>>             
>> >>>             RETURNING *""" % (conf_getint('DEFAULT', 'push_count',
>> >>>             5000),)
>> >> 
> 
> Thanks to all for taking an interest so far, this bug is... weird.

This seems to likely be the same, still open, bug reported previously:

No Number Assigned:
http://www.postgresql.org/message-id/CANCipfpfzoYnOz5jj=UZ70_R=CwDHv36dqWSpwsi27vpm1z5sA@xxxxxxxxxxxxxx

#8464
http://www.postgresql.org/message-id/E1VN53g-0002Iy-Il@xxxxxxxxxxxxxxxxxxxxxxx

#8470 is referenced in the first thread as well...though that is
specifically a performance issue and not a query bug.

The recommended work-around is to move the sub-query using the "FOR UPDATE"
into a CTE.

David J.




--
View this message in context: http://postgresql.1045698.n5.nabble.com/Receiving-many-more-rows-than-expected-tp5803179p5803406.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux