Skip site navigation (1) Skip section navigation (2)

Re: Function trunc() behaves in unexpected manner with different data types

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, Nathan M(dot) Davalos <n(dot)davalos(at)sharedmarketing(dot)com>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Function trunc() behaves in unexpected manner with different data types
Date: 2011-02-25 15:40:09
Message-ID: 1298648330-sup-361@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-bugs
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 <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

pgsql-bugs by date

Next:From: Merlin MoncureDate: 2011-02-25 15:48:50
Subject: Re: Function trunc() behaves in unexpected manner with different data types
Previous:From: Tom LaneDate: 2011-02-25 15:39:19
Subject: Re: BUG #5900: Coredump on executing query

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group