Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nL6jW-0004Ii-By for pgsql-general@arkaria.postgresql.org; Fri, 18 Feb 2022 17:07:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nL6jV-0003It-22 for pgsql-general@arkaria.postgresql.org; Fri, 18 Feb 2022 17:07:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nL6jU-0003Ik-GA for pgsql-general@lists.postgresql.org; Fri, 18 Feb 2022 17:07:48 +0000 Received: from smtprelay03.ispgateway.de ([80.67.18.15]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nL6jN-0006GF-NI for pgsql-general@lists.postgresql.org; Fri, 18 Feb 2022 17:07:47 +0000 Received: from [109.90.124.214] (helo=mail.office.datagis.com) by smtprelay03.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nL6jV-0005tf-6q; Fri, 18 Feb 2022 18:07:49 +0100 Received: from localhost (intranator.datagis.local [127.0.0.1]) by localhost (Postfix) with ESMTP id 5B0A3344; Fri, 18 Feb 2022 18:07:36 +0100 (CET) X-Virus-Scanned: by Intra2net Mail Security (AVE=8.3.64.92,VDF=8.19.7.136) X-Spam-Status: X-Spam-Level: 0 Received: from [192.168.12.10] (dslb-002-205-128-037.002.205.pools.vodafone-ip.de [2.205.128.37]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: smtp-auth-user) by mail.office.datagis.com (Postfix) with ESMTPSA id 4155723D; Fri, 18 Feb 2022 18:07:35 +0100 (CET) Message-ID: <6593fee3-477b-6069-f91e-79f91075808f@datagis.com> Date: Fri, 18 Feb 2022 18:07:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: Strange results when casting string to double Content-Language: en-US To: Tom Lane Cc: Peter Eisentraut , pgsql-general@lists.postgresql.org References: <0d711ac6-6975-ae07-8963-aa91c6500776@datagis.com> <4592fac1-05b2-f775-3332-c5a7d4c65b9d@datagis.com> <3950189.1645198347@sss.pgh.pa.us> From: Carsten Klein Organization: DataGis In-Reply-To: <3950189.1645198347@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Df-Sender: NTkwMDE1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 18.02.2022 16:32, Tom Lane wrote: > Yeah, you said that upthread, which makes the whole thing pretty > baffling. One possible explanation is that your small program got linked > against a different version of libc than what the Postgres backend is > using ("ldd" would help you check that, but given the age of the Postgres > installation, this seems plausible). Beyond that it's hard to think > of any explanation other than hardware fault or corrupted executable. Tom, both PostgreSQL and my C program are linked to the same libc.so.6. Same path, same MD5 sum. Since libc is a Shared Object (so), both processes should really run the identical code. Am I missing something? I've written and compiled the small C program on the same old Ubuntu OS. So, you're not aware of any ways this behavior could be achieved from within PostgreSQL? Something like a custom cast (actually, there is none) or something that could intercept string to double conversion? That would be something to look at closer. The question is: how would you implement such an evil database wide text to double conversion (just to kid users) if you had to? PostgreSQL is up for more than 480 days on that server. I'm thinking of giving a restart of the database a try. However, there's a long running import taking place, so this will not happen before mid or end of next week. Regards, Carsten