Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 8ED751337B61 for ; Fri, 25 Feb 2011 11:40:23 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 88168-05 for ; Fri, 25 Feb 2011 15:40:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id 941131337B43 for ; Fri, 25 Feb 2011 11:40:15 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id D471334802C; Fri, 25 Feb 2011 07:40:15 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aAOrF3xsXPSl; Fri, 25 Feb 2011 07:40:14 -0800 (PST) Received: from perhan.alvh.no-ip.org (unknown [200.85.212.94]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 799CA348027; Fri, 25 Feb 2011 07:40:13 -0800 (PST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id C52536E457; Fri, 25 Feb 2011 12:40:09 -0300 (CLST) Content-Type: text/plain; charset=UTF-8 Cc: Tom Lane , Greg Stark , Nathan M. Davalos , pgsql-bugs Subject: Re: Function trunc() behaves in unexpected manner with different data types From: Alvaro Herrera To: Merlin Moncure In-reply-to: References: <2701CF596B80DC44815FDBFFF5881A1E0104BB63@exchange01.sharedmarketing.com> <21330.1298647285@sss.pgh.pa.us> Date: Fri, 25 Feb 2011 12:40:09 -0300 Message-Id: <1298648330-sup-361@alvh.no-ip.org> User-Agent: Sup/git Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201102/221 X-Sequence-Number: 29493 Excerpts from Merlin Moncure's message of vie feb 25 12:28:25 -0300 2011: > no I wouldn't, and the pg_dump extra_float_digits setting addresses my > primary concern. The client has a similar issue though -- suppose it > fetches a value from the server and updates it back -- which record > gets the update? You would get different results if the client was > using binary or text features of the protocol. Not saying this is > wrong or needs to be fixed, just pointing it out :-). > > update foo set val=val + 1 where val = 2183.68; I think the mere idea of using floating point equality on a WHERE clause is bogus, regardless of text or binary format. -- Álvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support