pg_size_pretty.slt 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Copyright 1994, Regents of the University of California.
  2. # Copyright 1996-2024 PostgreSQL Global Development Group.
  3. # Copyright Materialize, Inc. and contributors. All rights reserved.
  4. #
  5. # Use of this software is governed by the Business Source License
  6. # included in the LICENSE file at the root of this repository.
  7. #
  8. # As of the Change Date specified in that file, in accordance with
  9. # the Business Source License, use of this software will be governed
  10. # by the Apache License, Version 2.0.
  11. #
  12. # This file is derived from the regression test suite in PostgreSQL.
  13. # The original file was retrieved on Jul 15, 2024 from:
  14. #
  15. # https://github.com/postgres/postgres/blob/74e12db19cbc78258a92da8be637a3fb0106b126/src/test/regress/expected/dbsize.out
  16. #
  17. # The original source code is subject to the terms of the PostgreSQL
  18. # license, a copy of which can be found in the LICENSE file at the
  19. # root of this repository.
  20. mode cockroach
  21. query TTT rowsort
  22. SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
  23. (VALUES (10::bigint), (1000::bigint), (1000000::bigint),
  24. (1000000000::bigint), (1000000000000::bigint),
  25. (1000000000000000::bigint)) x(size);
  26. ----
  27. 10 10␠bytes -10␠bytes
  28. 1000 1000␠bytes -1000␠bytes
  29. 1000000 977␠kB -977␠kB
  30. 1000000000 954␠MB -954␠MB
  31. 1000000000000 931␠GB -931␠GB
  32. 1000000000000000 909␠TB -909␠TB
  33. query TTT rowsort
  34. SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
  35. (VALUES (10::numeric), (1000::numeric), (1000000::numeric),
  36. (1000000000::numeric), (1000000000000::numeric),
  37. (1000000000000000::numeric),
  38. (10.5::numeric), (1000.5::numeric), (1000000.5::numeric),
  39. (1000000000.5::numeric), (1000000000000.5::numeric),
  40. (1000000000000000.5::numeric)) x(size);
  41. ----
  42. 10 10␠bytes -10␠bytes
  43. 1000 1000␠bytes -1000␠bytes
  44. 1000000 977␠kB -977␠kB
  45. 1000000000 954␠MB -954␠MB
  46. 1000000000000 931␠GB -931␠GB
  47. 1000000000000000 909␠TB -909␠TB
  48. 10.5 10.5␠bytes -10.5␠bytes
  49. 1000.5 1000.5␠bytes -1000.5␠bytes
  50. 1000000.5 977␠kB -977␠kB
  51. 1000000000.5 954␠MB -954␠MB
  52. 1000000000000.5 931␠GB -931␠GB
  53. 1000000000000000.5 909␠TB -909␠TB
  54. query TTT rowsort
  55. SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
  56. (VALUES (10239::bigint), (10240::bigint),
  57. (10485247::bigint), (10485248::bigint),
  58. (10736893951::bigint), (10736893952::bigint),
  59. (10994579406847::bigint), (10994579406848::bigint),
  60. (11258449312612351::bigint), (11258449312612352::bigint)) x(size);
  61. ----
  62. 10239 10239␠bytes -10239␠bytes
  63. 10240 10␠kB -10␠kB
  64. 10485247 10239␠kB -10239␠kB
  65. 10485248 10␠MB -10␠MB
  66. 10736893951 10239␠MB -10239␠MB
  67. 10736893952 10␠GB -10␠GB
  68. 10994579406847 10239␠GB -10239␠GB
  69. 10994579406848 10␠TB -10␠TB
  70. 11258449312612351 10239␠TB -10239␠TB
  71. 11258449312612352 10␠PB -10␠PB
  72. query TTT rowsort
  73. SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
  74. (VALUES (10239::numeric), (10240::numeric),
  75. (10485247::numeric), (10485248::numeric),
  76. (10736893951::numeric), (10736893952::numeric),
  77. (10994579406847::numeric), (10994579406848::numeric),
  78. (11258449312612351::numeric), (11258449312612352::numeric),
  79. (11528652096115048447::numeric), (11528652096115048448::numeric)) x(size);
  80. ----
  81. 10239 10239␠bytes -10239␠bytes
  82. 10240 10␠kB -10␠kB
  83. 10485247 10239␠kB -10239␠kB
  84. 10485248 10␠MB -10␠MB
  85. 10736893951 10239␠MB -10239␠MB
  86. 10736893952 10␠GB -10␠GB
  87. 10994579406847 10239␠GB -10239␠GB
  88. 10994579406848 10␠TB -10␠TB
  89. 11258449312612351 10239␠TB -10239␠TB
  90. 11258449312612352 10␠PB -10␠PB
  91. 11528652096115048447 10239␠PB -10239␠PB
  92. 11528652096115048448 10240␠PB -10240␠PB