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.89) (envelope-from ) id 1hqQgW-0001lC-GU for psycopg@arkaria.postgresql.org; Wed, 24 Jul 2019 23:28:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hqQgU-0001eR-ND for psycopg@arkaria.postgresql.org; Wed, 24 Jul 2019 23:28:34 +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 1hqQgU-0001eK-Av for psycopg@lists.postgresql.org; Wed, 24 Jul 2019 23:28:34 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hqQgQ-0008Or-5j for psycopg@postgresql.org; Wed, 24 Jul 2019 23:28:33 +0000 Received: by mail-pf1-x436.google.com with SMTP id b13so21696291pfo.1 for ; Wed, 24 Jul 2019 16:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hbaspecto-com.20150623.gappssmtp.com; s=20150623; h=from:mime-version:subject:message-id:date:to; bh=K/7F4HMHIRlzQ/LSVN5ZUnR32GCKmZasETf2dtU1x1E=; b=Ngu9yaAJlXKVjuOXenUAu17SDZ3M7k7V6qWGpRZngTJBTzej5JjavU7TieUwASXOx2 yXy4bVvkc60X1q6YfafxuljB6SZv0FXq3i20VNJ/PKp/4xJf55xQjGsqYy9TmKiTqWtY JyqIMt0cElZNzTlkg9VKRo4jp53jz6T54UMbBw9YV+TbXfgawgvlAhShq4crlgQAbtMX evloyt34wNAnHs++B+Gq1kozJoxjsEhuz1C+kqo+kOqZPKR3iGwuRHKm8cMoZruf2O7D WlSTDMEZ/0MY3k4rfASOupDN4YxlGmSBbg9DxWJRBU8wCDegPu8ai+k5UmSwovwNAOSd fmow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=K/7F4HMHIRlzQ/LSVN5ZUnR32GCKmZasETf2dtU1x1E=; b=WjF2NIdn+H/CykGj+s7wV6CGeySJVP/kLhbNzJYbD4W7WMSdU8pClg2Dgd5/Ljn+iT QLzG3ILizdNPF8/qeDurXdVaBSdt6I8DkqBNJGPPCXJsbkaC77ubKUhZaDENVWiEf5jb gJO/qXdSnT1cG6IuRQ3aXPHgN+TZrdsyiFSf5fjUgO5fT0S0YZX4zyvNrddziL+OUqhh rEiOO66iTS/VqzZcSr4VXn+93CnqufTnZSEqB449Jlab3yD5e0lYXfQTXM13feA2NWR0 XZP/rJKXlUmSCy5SYEbQJYt75rO42xfGfa9YISQWeaaC3/Irfrp12iqzZqWUMssb1+IS Kmqw== X-Gm-Message-State: APjAAAX1N33OxAILS4aFCi4xwDfiGD2nFLti7JSNa1O/zDzqOR/SON6o w1Wz5GuDO4Dp0QVmmTrsuaRip/eXE5I= X-Google-Smtp-Source: APXvYqy0K5dOQFyRAk9EBaWALIi40LXqEa2wQmdTXJdKrMxIS+pyskPE/UM7WDMsXTbJKgk9jbUQuA== X-Received: by 2002:a17:90a:1a0d:: with SMTP id 13mr85401419pjk.99.1564010907151; Wed, 24 Jul 2019 16:28:27 -0700 (PDT) Received: from [10.8.0.16] ([184.68.204.138]) by smtp.gmail.com with ESMTPSA id v12sm40678463pjk.13.2019.07.24.16.28.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jul 2019 16:28:26 -0700 (PDT) From: John Abraham Content-Type: multipart/alternative; boundary="Apple-Mail=_A3F1E974-F284-438D-AC7C-E4C116AC79BA" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Rounding numbers from copy expert Message-Id: <8DC745DF-DDF9-4697-BAAF-23ABE78A1EB9@hbaspecto.com> Date: Wed, 24 Jul 2019 16:28:02 -0700 To: psycopg@postgresql.org X-Mailer: Apple Mail (2.3445.104.11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_A3F1E974-F284-438D-AC7C-E4C116AC79BA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hmm, I have two machines connecting to the same database running the = same query inside copy_expert. Both seem to have psycopg2 2.7.5 (based on pip3 freeze). One seems to be rounding the double precision number 696538951.985381 to = 6.96538944E8 whereas the other machine isn't rounding it. This is causing auditability/repeatability problems, as the difference = is actually significant in this context. Is there some thing about the way psycopg2 connects to the database, or = the way psycopg2 is configured, that could be causing this rounding? Is = there some way to express a preference for scientific notation? =20 I'm at a complete loss as to why copy_expert (which basically does a = 'copy to stdin' query) would be different when called from different = machines. My next step in the madness is to see if the locale has an = effect, one is set to en_CA.UTF-8 and the other is set to en_US.UTF-8. = But, perhaps someone else has a better idea.=20 Thanks for any help.=20 -- John Abraham jea@hbaspecto.com 403-232-1060 --Apple-Mail=_A3F1E974-F284-438D-AC7C-E4C116AC79BA Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Hmm, = I have two machines connecting to the same database running the same = query inside copy_expert.

Both seem to have psycopg2 2.7.5 (based on pip3 = freeze).

One = seems to be rounding the double precision number 696538951.985381= to 6.96538944E8 whereas the other machine isn't rounding = it.

This is causing auditability/repeatability problems, = as the difference is actually significant in this = context.

Is there some = thing about the way psycopg2 connects to the database, or the way = psycopg2 is configured, that could be causing this rounding? Is there = some way to express a preference for scientific notation? =  

I'm at a complete = loss as to why copy_expert (which basically does a 'copy to stdin' = query) would be different when called from different machines. My next = step in the madness is to see if the locale has an effect, one is set = to en_CA.UTF-8 and the other is set to en_US.UTF-8.  But, = perhaps someone else has a better idea. 

Thanks for any help. 

--
John Abraham
403-232-1060

= --Apple-Mail=_A3F1E974-F284-438D-AC7C-E4C116AC79BA--