pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Merlin Moncure <mmoncure@gmail.com>
Cc: Greg Stark <gsstark@mit.edu>
Cc: Nathan M. Davalos <n.davalos@sharedmarketing.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Function trunc() behaves in unexpected manner with different data types
Date: Fri, 25 Feb 2011 10:21:25 -0500
Message-ID: <21330.1298647285@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTinjSDnwhKXWqJNMTnxah75-RJf2A4svXBsqP_Fh@mail.gmail.com>
References: <2701CF596B80DC44815FDBFFF5881A1E0104BB63@exchange01.sharedmarketing.com>
	<AANLkTimWoBDGLN282PLRkg2eCuZTS6KJCEH_m0uQHrb-@mail.gmail.com>
	<AANLkTin81WeP3+gOjyp6bX-m26vUjcBRBd2GRGkWwMxZ@mail.gmail.com>
	<AANLkTinjSDnwhKXWqJNMTnxah75-RJf2A4svXBsqP_Fh@mail.gmail.com>

Merlin Moncure <mmoncure@gmail.com> writes:
> right -- in understand how floating point works -- but are you are
> saying that you are ok with the fact that (for example) a table with a
> floating point unique key could dump and not restore? more
> specifically, a binary dump would restore but a text dump would not.

pg_dump takes measures against that (see extra_float_digits).

> I think this is a problem with our implementation -- not all versions
> of 2183.68 as outputted from the server are the same internally.

It's an inherent property of float math.  Yes, we could set the default
value of extra_float_digits high enough that distinct internal values
always had distinct text representations, but trust me, you would not
like it.

			regards, tom lane



view thread (9+ messages)  latest in thread

Message-ID: <21330.1298647285@sss.pgh.pa.us>
Permalink:  ../21330.1298647285@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21330.1298647285@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mmoncure@gmail.com, gsstark@mit.edu, n.davalos@sharedmarketing.com
  Subject: Re: Function trunc() behaves in unexpected manner with different data types
  In-Reply-To: <21330.1298647285@sss.pgh.pa.us>
  References: <2701CF596B80DC44815FDBFFF5881A1E0104BB63@exchange01.sharedmarketing.com> <AANLkTimWoBDGLN282PLRkg2eCuZTS6KJCEH_m0uQHrb-@mail.gmail.com> <AANLkTin81WeP3+gOjyp6bX-m26vUjcBRBd2GRGkWwMxZ@mail.gmail.com> <AANLkTinjSDnwhKXWqJNMTnxah75-RJf2A4svXBsqP_Fh@mail.gmail.com> <21330.1298647285@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox