mirror of https://github.com/postgres/postgres
Previously, negative values were always displayed in bytes, regardless of how large they were. Adrian Vondendriesch, reviewed by Julien Rouhaud and myselfpull/14/head^2
parent
dde5f09fad
commit
8a1fab36ab
@ -0,0 +1,37 @@ |
||||
SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM |
||||
(VALUES (10::bigint), (1000::bigint), (1000000::bigint), |
||||
(1000000000::bigint), (1000000000000::bigint), |
||||
(1000000000000000::bigint)) x(size); |
||||
size | pg_size_pretty | pg_size_pretty |
||||
------------------+----------------+---------------- |
||||
10 | 10 bytes | -10 bytes |
||||
1000 | 1000 bytes | -1000 bytes |
||||
1000000 | 977 kB | -977 kB |
||||
1000000000 | 954 MB | -954 MB |
||||
1000000000000 | 931 GB | -931 GB |
||||
1000000000000000 | 909 TB | -909 TB |
||||
(6 rows) |
||||
|
||||
SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM |
||||
(VALUES (10::numeric), (1000::numeric), (1000000::numeric), |
||||
(1000000000::numeric), (1000000000000::numeric), |
||||
(1000000000000000::numeric), |
||||
(10.5::numeric), (1000.5::numeric), (1000000.5::numeric), |
||||
(1000000000.5::numeric), (1000000000000.5::numeric), |
||||
(1000000000000000.5::numeric)) x(size); |
||||
size | pg_size_pretty | pg_size_pretty |
||||
--------------------+----------------+---------------- |
||||
10 | 10 bytes | -10 bytes |
||||
1000 | 1000 bytes | -1000 bytes |
||||
1000000 | 977 kB | -977 kB |
||||
1000000000 | 954 MB | -954 MB |
||||
1000000000000 | 931 GB | -931 GB |
||||
1000000000000000 | 909 TB | -909 TB |
||||
10.5 | 10.5 bytes | -10.5 bytes |
||||
1000.5 | 1000.5 bytes | -1000.5 bytes |
||||
1000000.5 | 977 kB | -977 kB |
||||
1000000000.5 | 954 MB | -954 MB |
||||
1000000000000.5 | 931 GB | -931 GB |
||||
1000000000000000.5 | 909 TB | -909 TB |
||||
(12 rows) |
||||
|
||||
@ -0,0 +1,12 @@ |
||||
SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM |
||||
(VALUES (10::bigint), (1000::bigint), (1000000::bigint), |
||||
(1000000000::bigint), (1000000000000::bigint), |
||||
(1000000000000000::bigint)) x(size); |
||||
|
||||
SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM |
||||
(VALUES (10::numeric), (1000::numeric), (1000000::numeric), |
||||
(1000000000::numeric), (1000000000000::numeric), |
||||
(1000000000000000::numeric), |
||||
(10.5::numeric), (1000.5::numeric), (1000000.5::numeric), |
||||
(1000000000.5::numeric), (1000000000000.5::numeric), |
||||
(1000000000000000.5::numeric)) x(size); |
||||
Loading…
Reference in new issue