Re: BUG #17866: behavior does not match documentation
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: eugeny@zhuzhnev.com, pgsql-bugs <pgsql-bugs@lists.postgresql.org>,
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Date: 2023-03-23T21:54:50Z
Lists: pgsql-bugs
Daniel Gustafsson <daniel@yesql.se> writes: > On 23 Mar 2023, at 19:31, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> I wonder if we should rethink that and have these operations strip >> insignificant trailing zeroes. > Any app relying on insignificant trailing zeroes seems broken, but the inverse > can be argued as well. It's however quite easy to argue for the stripped > output being more readable though. It's more readable for sure, and it duplicates what you got in pre-v14 versions, at least textually. I'm not sure I'd propose back-patching this, but it feels like a good idea for HEAD. The argument for the current behavior probably goes like "we're exposing the actual precision of the value". But I don't believe that we are; we're exposing the maximum possible precision. We have no way to know how precise the original timestamp or interval input was. So I don't think there's much basis for claiming that the result is good to six fractional digits. regards, tom lane
Commits
-
Doc: adjust examples of EXTRACT() output to match current reality.
- fbbd7edca867 16.0 landed
- 707691ea620e 15.3 landed
- 07a9f4f73386 14.8 landed
-
Change return type of EXTRACT to numeric
- a2da77cdb466 14.0 cited