Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jDdks-0001Ib-Sq for pgsql-general@arkaria.postgresql.org; Mon, 16 Mar 2020 00:37:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jDdkr-0004gJ-LC for pgsql-general@arkaria.postgresql.org; Mon, 16 Mar 2020 00:37:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jDdkr-0004gB-84 for pgsql-general@lists.postgresql.org; Mon, 16 Mar 2020 00:37:17 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jDdkj-0002mT-Ru for pgsql-general@postgresql.org; Mon, 16 Mar 2020 00:37:16 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AF5FB21EA0; Sun, 15 Mar 2020 20:37:08 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 15 Mar 2020 20:37:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=O 7qx4ssDaMWXukeoXf83bBllXMJJ3S/kNqrPdBE4xJU=; b=tiVOvyxy9AiltZT+f QpdmM3s1P/RO9qnLmpl5RgjGXFpuPpYRL3UcS/jASUe25NO/0AB+kv56R6Dq0Piz 2l/b9NVm1mBojw+a4Xk7aWTJDhGc019xZ3IhD9uG0DUAhRHu66kY8iEBOr7umerM x1KIzdL3KepobBaky2NTC9hY0axYVbiyGs+vkQdO53vphUBEArj7+i3WZqFEekGb awioiLgXOJc+pmlwda8l/WULYfh1yL9wAUTUpem5RX5UEFzpWUz1RXstpJS1+GaE ExLbO8Tz8CDhniT+bhVENQLmXuWtRzIan8y9Xt73VSCWCNsrlwTO+wT4zEun71aY L/Kdw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=O7qx4ssDaMWXukeoXf83bBllXMJJ3S/kNqrPdBE4x JU=; b=xFTVuf8irlH9jJz+euHvOcylZBuN5E/x15TdM0FMku8Hr0AN/y7RuyCpy QyxE3/3IuIpm0vfus6h+KjMR64nsTw7k43qLmjLexlJuvegokS5cLzCEghMhMiZn HWQIEUc72uGTns0YcbVp6uXflCpZkXsTzGJtxD8I6ok/ExkvwbCgsvwrREZ8XW5T 9psfcGtPgt7nRK1BN5UyEQckS/7necRP7H89nWBLoxCU0wpsGvLNnMVa1wJV88WF 1v5NGrLZmdX3iXY90R4zHyQnKQV0StBlp1CU1YeYDuEcb0Dv4lmHRTZjxRL+CqOn aqs/GL2MIDxmxAfuwYfrV8EDyeG1g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudefuddgleefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucfkphepjedurddvuddvrdduvdelrdduleefnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklh grvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.10] (unknown [71.212.129.193]) by mail.messagingengine.com (Postfix) with ESMTPA id 1E07E3061856; Sun, 15 Mar 2020 20:37:08 -0400 (EDT) Subject: Re: Order by and timestamp To: =?UTF-8?Q?Bj=c3=b6rn_Lundin?= , pgsql-general@postgresql.org References: <63004F55-4CA3-40F8-A898-E7A646B0EBD3@gmail.com> From: Adrian Klaver Message-ID: Date: Sun, 15 Mar 2020 17:37:07 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <63004F55-4CA3-40F8-A898-E7A646B0EBD3@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/15/20 2:33 PM, Björn Lundin wrote: > Hi! > I have an old database that behaves a bit strange. > I keeps horse races in UK/IE. > I have a program that continuously* adds record into a market table , > described as below. > > *continuously means ’after each race’ which is ca 12:00 --> 23:00. > > I then did ’select * from AMARKETS order by STARTTS’ Is amarkets in more then one schema? If so what is search_path? I could not replicate the below. What does below show?: select '2016-09-30 13:00:00'::timestamp at time zone 'UTC'; select '2016-10-01 15:35:00'::timestamp at time zone 'UTC'; > > And to my surprise i get a result like this  (note the order of column > STARTTS) > >   marketid   |        marketname        |       startts       | eventid > …. > …. > >  1.127275701 | To Be Placed             | 2016-10-01 14:25:00 | 27953172 | >  1.127275705 | 1m Grp1                  | 2016-10-01 15:00:00 | 27953172 | >  1.127275708 | To Be Placed             | 2016-10-01 15:00:00 | 27953172 | >  1.127275715 | To Be Placed             | 2016-10-01 15:35:00 | 27953172 | >  1.127275722 | To Be Placed             | 2016-10-01 16:10:00 | 27953172 | >  1.127278857 | 7f Hcap                  | 2016-09-30 13:00:00 | 27953255 | >  1.127278858 | To Be Placed             | 2016-09-30 13:00:00 | 27953255 | >  1.127278862 | 1m Class Stks            | 2016-09-30 13:35:00 | 27953255 | >  1.127278863 | To Be Placed             | 2016-09-30 13:35:00 | 27953255 | >  1.127278867 | 6f Hcap                  | 2016-09-30 14:10:00 | 27953255 | > … > …. > > > regards > -- > Björn Lundin > b.f.lundin@gmail.com > > > -- Adrian Klaver adrian.klaver@aklaver.com