pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: kehan5800@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19744: contrib/seg output truncates to 6 significant digits, breaking dump/restore
Date: Mon, 05 Oct 2026 17:52:49 -0400
Message-ID: <1203131.1791237169@sss.pgh.pa.us> (raw)
In-Reply-To: <19744-8c700582bbb1d075@postgresql.org>
References: <19744-8c700582bbb1d075@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> In practice a 7-significant-digit value is stored exactly

Some of them are, but please don't claim that on the strength of
one test case.

> but printed with 6 digits:

>     CREATE EXTENSION seg;
>     SELECT '1234567'::seg                           AS printed,
>            seg_lower('1234567'::seg)::float8        AS stored,
>            '1234567'::seg::text::seg = '1234567'::seg AS round_trips;

I do not think this is a code bug.  The code clearly intends to render
values exactly as long as they're no more than FLT_DIG digits wide,
and it accomplishes that, and it cannot expect to do more because
the underlying storage can't promise more.

It does seem like a documentation bug that the docs are written
as if FLT_DIG were 7.  That's not so on any modern platform,
and even when these docs were written I doubt that anything had
that.

			regards, tom lane






view thread (2+ messages)

Message-ID: <1203131.1791237169@sss.pgh.pa.us>
Permalink:  ../1203131.1791237169@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1203131.1791237169@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, kehan5800@gmail.com
  Subject: Re: BUG #19744: contrib/seg output truncates to 6 significant digits, breaking dump/restore
  In-Reply-To: <1203131.1791237169@sss.pgh.pa.us>
  References: <19744-8c700582bbb1d075@postgresql.org> <1203131.1791237169@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