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 1jDvNW-0002m8-1Y for pgsql-general@arkaria.postgresql.org; Mon, 16 Mar 2020 19:26:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jDvNU-00046y-Qu for pgsql-general@arkaria.postgresql.org; Mon, 16 Mar 2020 19:26:20 +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 1jDvNT-00046q-MO for pgsql-general@lists.postgresql.org; Mon, 16 Mar 2020 19:26:20 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jDvNQ-0006Ud-EV for pgsql-general@postgresql.org; Mon, 16 Mar 2020 19:26:19 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id D76D751A; Mon, 16 Mar 2020 15:26:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 16 Mar 2020 15:26:14 -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=k PhUXMQdhV7u4ZxpJpN5EHR6VMUxkVqORfkzSICcI+M=; b=jhMXAut+oKdrfuyII tJSsXiO6G+sLMu4lf5DLaH1JN7zgEB26P0m68hhSZcflNgLGfdV0/FbTtokdanPG Sx5TCvVuHO7CBKTxqsltFV3qBzrGLOm9CpIGwN+IlDnwV+B/5rcJ1yybd9SL9YAP pPeZTmPRKbQiMuSbUF4W6ufvmC4jjIZXpEGpvAylSVR1X0MReuPh08xzTKE/MIbS 70naGh5Lufl7NBrlnZEg5NK3Hox0f/Ufald30Gz8NxP2tDGrZ7YawgAG+8s3BgD0 SBUrcyNsTTGN/tn+Nmfkug+V7iNBhi4M61j/22FYtVDRRiYoPKsD3FznTMpC34xc Zy0PQ== 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=kPhUXMQdhV7u4ZxpJpN5EHR6VMUxkVqORfkzSICcI +M=; b=0Sp3GGu5oAjhnplo842As8A+T/5+wqeUHZSiFze7Es9v6ZnIbiKs/eiJs dV0DyWatl2aziTudUy/iGDPr6MrrHAkFupNBhSa3wFTNZQYTSKx9ETwunxxRnstr dTV1k7w0b9ocYo8gYAiwZQEBJR06vt4AVX3C5ql6QGNMYHVAe1evyW39NXtxxV/f kZ9+CAVPIuxppuOP+5BTyC0/h+17WDek9qI68XBi59oluoyjDJZmWW2RezOSeZi2 o0bv1CtW9c/mC0EtmNanGQQYT9PWxEqk1PgjibUiqbPxGd/uUuxyHOIbrdMNDQak wgnDAgoSzkWmG+D+rCSABWlRC6k5g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudeffedguddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecukfhppeejuddrvdduvddruddvledrudelfeenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkh hlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.10] (unknown [71.212.129.193]) by mail.messagingengine.com (Postfix) with ESMTPA id 4BE12328005E; Mon, 16 Mar 2020 15:26:12 -0400 (EDT) Subject: Re: Order by and timestamp To: =?UTF-8?Q?Bj=c3=b6rn_Lundin?= Cc: Tom Lane , pgsql-general@postgresql.org References: <63004F55-4CA3-40F8-A898-E7A646B0EBD3@gmail.com> <24142.1584319263@sss.pgh.pa.us> <7D74B8B5-DFBD-4B5B-85C6-A516343E49C1@gmail.com> <346C3B58-D29E-4CC2-8200-691ECA91F494@gmail.com> <10f84f23-6011-28ab-79a1-a1c259424d2e@aklaver.com> <72890A04-294E-4753-8839-69F0BAD9AA17@gmail.com> <9004c731-b2eb-faaa-6dc9-6ebd231c5879@aklaver.com> From: Adrian Klaver Message-ID: <5e1a2f75-2d9c-889b-7504-63edb615caf6@aklaver.com> Date: Mon, 16 Mar 2020 12:26:11 -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: 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 11:56 AM, Björn Lundin wrote: > > > >>> Ooh - terrible sorry. >>> The output from first post describing the database schema >>> Was actually from my production machine - a raspberry pi. >>> The pi hold a db on an usb-disk, which is pg_dump()ed every night and >>> imported to ibm2 history db (the bad one) >>> The schema is identical to the one with trouble - which is a history >>> database >>> Intended for testing >> >> To be clear the RPI version of the database sorts correctly? > > > Yes, but as I replied to Tom, it only contains a days worth of data, > then pg_dump()ed and truncated. > Tas data is imported to > * the faulty one (ibm2/debian/9.4) > * the correct one (tp/ubuntu/pg 10.6) Per Tom's comment, what are the encodings? Also I would point out that the problem occurs on the machine you are dumping/restoring backwards 9.6 --> 9.4. Not sure if that is relevant or not, but worth looking at. How is the dump/restore done(plain text, custom format, etc) and what are the command strings? Also what versions of pg_dump/pg_restore are you using on the dump and restore sides for the various Postgres versions? More below. > > >> >>> I did not realize that would matter when posting - did the post away >>> from home, >> >> >> Yes, it would be have been nice to know at the outset there where >> multiple instances involved. > > Hmm did not realize that. It’s hard to know when to leave out > ’insignificant details’ and when not to. > (Ie when the details turn out to be significant) > I saw a machine - with its current data - sort in a for me strange way. > Then it struck me that I have another (semi-retired) machine with > basically the same data, > Enetered the same way, with the same import files, that works > > So in a sense many instances, but not really. Yes really, otherwise you would not be seeing a difference. Sorry, pet peeve of mine, when people say these two things are not doing the same thing but then say they are the same thing. > I mean, the pg_dump does copy-commands. It also does a certain amount of setup at the beginning of the file. > I could have inserted that by hand. > > -- > Björn Lundin > b.f.lundin@gmail.com > > > > -- Adrian Klaver adrian.klaver@aklaver.com