Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 251FC6341C4 for ; Mon, 20 Apr 2009 07:57:18 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 82633-02-3 for ; Mon, 20 Apr 2009 07:57:08 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kickstone.com (smtp.kickstone.com [87.194.183.70]) by mail.postgresql.org (Postfix) with ESMTP id BA08563F13A for ; Mon, 20 Apr 2009 05:48:00 -0300 (ADT) Received: from madras2.square-pi.com ([192.168.2.131]:4981 helo=MADRAS2) by mail.kickstone.com with esmtpa (Exim 4.69) (envelope-from ) id 1LvpAR-0008RO-RY; Mon, 20 Apr 2009 09:47:55 +0100 Message-ID: From: "John Lister" To: "Craig Ringer" Cc: References: <49E72C90.9010903@enterprisedb.com> <49EB6ABD.7020308@kickstone.com> <49EBCB67.5080806@postnewspapers.com.au> Subject: Re: Unit tests and ordering Date: Mon, 20 Apr 2009 09:47:55 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.205 tagged_above=0 required=5 tests=AWL=0.205 X-Spam-Level: X-Archive-Number: 200904/71 X-Sequence-Number: 19518 >> This seems to be an ordering problem.. The dates are inserted and then >> the test relies on them being returned in the same order they were >> inserted. I'm fairly sure that this isn't guaranteed when using SQL, > > Correct. Your tests are broken, you REALLY need an ORDER BY clause if you > depend on the order of the result set. Alternately, adjust your tests to > not care about the result set order. I thought so... >> however it looks like it probably worked before. > > The only major change I can personally think of that might've affected > that is synchronized scans. If you have more than one backend reading the > table at once using a sequential scan, one of them will usually pick up > part-way through the table then go back to the beginning once it hits the > end. I'm not sure if that's likely to be related to what you're seeing. > > In any case, you REALLY need an appropriate ORDER BY clause. It should be simple to correct the tests, by adding a serial id field and ordering on that... Thanks JOHN