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 1jDrbx-0000rB-Kf for pgsql-general@arkaria.postgresql.org; Mon, 16 Mar 2020 15:25:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jDrbw-0005eK-D6 for pgsql-general@arkaria.postgresql.org; Mon, 16 Mar 2020 15:25:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jDrbu-0005ds-I8 for pgsql-general@lists.postgresql.org; Mon, 16 Mar 2020 15:25:00 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jDrbr-0004Xb-LZ for pgsql-general@postgresql.org; Mon, 16 Mar 2020 15:24:58 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 109665C02C2; Mon, 16 Mar 2020 11:24:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 16 Mar 2020 11:24:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=b 0VQtTlFRLNvInBUUmFlHnYPTDzjVTZzD/mavny18bk=; b=YzL1ZBC1mK78fxKyw vQjA1wvmepdiOVNeVmnT5ubAFqo4zFmqvIH9NJVfcaDw97Njpq04R4YAMI233XkU o8KPN1yhXygEPBD6BHFgoawRtUhFfdGAeKKmZO76sQ8gBJ5SciWrx6jnMJ087Jfy BOzXEuLYxZsRdJYdQ5Rg+LHx2PGPi5Y2Q/9E2B9RLjsi6Zif4sxOxTeCOZg8KW8i kv85GGEkizvYD/hxgccq3EjoBVJ9gmMP0L8vzVim8xQyMCkh1fxSa+sfy2xmt26n E6oQoNipki4xqvZBiCZLB0FKhxgOVoIJgu4raQN26Ayl6kA3BkCASThKcJGCZ9cO drA7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=b0VQtTlFRLNvInBUUmFlHnYPTDzjVTZzD/mavny18 bk=; b=omB0ypQE8kKswF7J2HcZBLbE7zhSinaflLnRuD2yIPgiWTtSk3vdSUZlm 3KdPwhA7a1C9CmrqIn/BSfK8bNStngycvLN0+hW+AV10xyzMDk2MhpOXrUZCoGLn p91jQb1UwLFW0npc/RoCzrjYrFVDscMF8NOZLMYSWUMTKRXPx3JE9lXSzjmW42Ao 9Nc4rklmONCG1hRrAq2o+IUS8h48Bslig7FplcyjcEukUrefbS4IlYkvxihSgklv Ehgen8o7I8asn9FFj5sDcHgRmVFdfkgjomF0+t2BmizeqClSs4W93SPRt7DtkShw YaUt21NM0K89sjCqTRpoLdIP4fBEg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudeffedgjeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgpdgrmhgrrhhkvghtshdr shhonecukfhppeejuddrvdduvddruddvledrudelfeenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhl rghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.10] (unknown [71.212.129.193]) by mail.messagingengine.com (Postfix) with ESMTPA id 61CD73280060; Mon, 16 Mar 2020 11:24:53 -0400 (EDT) Subject: Re: Order by and timestamp To: =?UTF-8?Q?Bj=c3=b6rn_Lundin?= Cc: pgsql-general@postgresql.org References: <63004F55-4CA3-40F8-A898-E7A646B0EBD3@gmail.com> <48A75793-3914-40F5-877C-FD87AE85AE8A@gmail.com> From: Adrian Klaver Message-ID: <22d759ed-9ae1-de9a-936c-f8a48bcfaa0d@aklaver.com> Date: Mon, 16 Mar 2020 08:24:52 -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: <48A75793-3914-40F5-877C-FD87AE85AE8A@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/16/20 1:49 AM, Björn Lundin wrote: > > >> 16 mars 2020 kl. 01:37 skrev Adrian Klaver > >: >> >> 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? > > Yes but the table is empty in other schema (’dry’) - and has less idexes > It is also present in imports - but empty there as well Actually the below indicates it is in other databases. A schema would be a namespace within a database, see here: https://www.postgresql.org/docs/12/sql-createschema.html In your original example the 'public' in public.amarkets. So just to be complete \dn in psql will show you the schemas in a database. Given the search_path("$user",public) shown below I suspect you have only a public schema. $user matches a schema named for the current user and generally is not there. The times returned below match, so I am at a loss for an explanation at the moment. > > bnl@ibm2:~$ psql -l > Tidtagning är på. > AUTOCOMMIT off >                                 Lista med databaser >    Namn    |  Ägare   | Kodning | Jämförelse  |    Ctype    | > Åtkomsträttigheter > -----------+----------+---------+-------------+-------------+----------------------- >  bnl       | bnl      | UTF8    | sv_SE.UTF-8 | sv_SE.UTF-8 | >  dry       | bnl      | UTF8    | sv_SE.UTF-8 | sv_SE.UTF-8 | >  imports   | bnl      | UTF8    | sv_SE.UTF-8 | sv_SE.UTF-8 | >  postgres  | postgres | UTF8    | sv_SE.UTF-8 | sv_SE.UTF-8 | >  template0 | postgres | UTF8    | sv_SE.UTF-8 | sv_SE.UTF-8 | > =c/postgres          + >            |          |         |             |             | > postgres=CTc/postgres >  template1 | postgres | UTF8    | sv_SE.UTF-8 | sv_SE.UTF-8 | > =c/postgres          + >            |          |         |             |             | > >> If so what is search_path? > > bnl=> show search_path; >   search_path > ---------------- >  "$user",public > (1 rad) > > >> I could not replicate the below. >> >> What does below show?: >> >> select '2016-09-30 13:00:00'::timestamp at time zone 'UTC’; > > bnl=> select '2016-09-30 13:00:00'::timestamp at time zone 'UTC'; >         timezone > ------------------------ >  2016-09-30 15:00:00+02 > > >> select '2016-10-01 15:35:00'::timestamp at time zone ’UTC’ > bnl=> select '2016-10-01 15:35:00'::timestamp at time zone 'UTC'; >         timezone > ------------------------ >  2016-10-01 17:35:00+02 > > > -- > Björn Lundin > b.f.lundin@gmail.com > > > > -- Adrian Klaver adrian.klaver@aklaver.com