--
You received this message because you are subscribed to the Google Groups "pgTAP Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pgtap-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pgtap-users/1d7ad2a5-7f32-4a21-82e7-fce3b61d5368n%40googlegroups.com.
SELECT pg_temp.results_approx_equal(
$$select * from (values (1,50), (1, 10)) vals(a, b)$$,
$$select * from (values (2,55), (0, 5)) vals(a, b)$$,
json_build_object('a', 1, 'b', 5)
);
That test passes. In that code block I'm saying "consider two rows to be equivalent
if their a
columns differ by no more than 1
and their b
columns differ by no more than 5
.
Thanks for the input and help.
Sincerely, Kyle
Another option would be to create a numeric operator that ignores trailing zeros.
From: <pgtap...@googlegroups.com> on behalf of Kyle Jensen <klje...@gmail.com>
Date: Sunday, May 9, 2021 at 6:26 PM
To: Steve Baldwin <steve....@gmail.com>
Cc: "David E. Wheeler" <da...@justatheory.com>, pgTAP Users <pgtap...@googlegroups.com>
Subject: RE: [EXTERNAL] [pgtap-users] How best to test near equality with numeric values?
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. |
--
You received this message because you are subscribed to the Google Groups "pgTAP Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
pgtap-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pgtap-users/CAHV6TV4b-kdm3ztFh9zbfwVf9iaAkL1946861G1SvcNTH%2BYWgg%40mail.gmail.com.