dbsize.err 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <sql-statement>
  2. SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
  3. (VALUES (10::bigint), (1000::bigint), (1000000::bigint),
  4. (1000000000::bigint), (1000000000000::bigint),
  5. (1000000000000000::bigint)) x(size);
  6. </sql-statement>
  7. -stdin-:<main>: Error: Type annotation
  8. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
  9. SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
  10. ^
  11. -stdin-:<main>:1:1: Error: Duplicated member: pg_size_pretty
  12. SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
  13. ^
  14. <sql-statement>
  15. SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
  16. (VALUES (10::numeric), (1000::numeric), (1000000::numeric),
  17. (1000000000::numeric), (1000000000000::numeric),
  18. (1000000000000000::numeric),
  19. (10.5::numeric), (1000.5::numeric), (1000000.5::numeric),
  20. (1000000000.5::numeric), (1000000000000.5::numeric),
  21. (1000000000000000.5::numeric)) x(size);
  22. </sql-statement>
  23. -stdin-:<main>: Error: Type annotation
  24. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
  25. SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
  26. ^
  27. -stdin-:<main>:1:1: Error: Duplicated member: pg_size_pretty
  28. SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
  29. ^
  30. <sql-statement>
  31. -- test where units change up
  32. SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
  33. (VALUES (10239::bigint), (10240::bigint),
  34. (10485247::bigint), (10485248::bigint),
  35. (10736893951::bigint), (10736893952::bigint),
  36. (10994579406847::bigint), (10994579406848::bigint),
  37. (11258449312612351::bigint), (11258449312612352::bigint)) x(size);
  38. </sql-statement>
  39. -stdin-:<main>: Error: Type annotation
  40. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
  41. -- test where units change up
  42. ^
  43. -stdin-:<main>:1:1: Error: Duplicated member: pg_size_pretty
  44. -- test where units change up
  45. ^
  46. <sql-statement>
  47. SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
  48. (VALUES (10239::numeric), (10240::numeric),
  49. (10485247::numeric), (10485248::numeric),
  50. (10736893951::numeric), (10736893952::numeric),
  51. (10994579406847::numeric), (10994579406848::numeric),
  52. (11258449312612351::numeric), (11258449312612352::numeric)) x(size);
  53. </sql-statement>
  54. -stdin-:<main>: Error: Type annotation
  55. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
  56. SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
  57. ^
  58. -stdin-:<main>:1:1: Error: Duplicated member: pg_size_pretty
  59. SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
  60. ^
  61. <sql-statement>
  62. -- pg_size_bytes() tests
  63. SELECT size, pg_size_bytes(size) FROM
  64. (VALUES ('1'), ('123bytes'), ('1kB'), ('1MB'), (' 1 GB'), ('1.5 GB '),
  65. ('1TB'), ('3000 TB'), ('1e6 MB')) x(size);
  66. </sql-statement>
  67. <sql-statement>
  68. -- case-insensitive units are supported
  69. SELECT size, pg_size_bytes(size) FROM
  70. (VALUES ('1'), ('123bYteS'), ('1kb'), ('1mb'), (' 1 Gb'), ('1.5 gB '),
  71. ('1tb'), ('3000 tb'), ('1e6 mb')) x(size);
  72. </sql-statement>
  73. <sql-statement>
  74. -- negative numbers are supported
  75. SELECT size, pg_size_bytes(size) FROM
  76. (VALUES ('-1'), ('-123bytes'), ('-1kb'), ('-1mb'), (' -1 Gb'), ('-1.5 gB '),
  77. ('-1tb'), ('-3000 TB'), ('-10e-1 MB')) x(size);
  78. </sql-statement>
  79. <sql-statement>
  80. -- different cases with allowed points
  81. SELECT size, pg_size_bytes(size) FROM
  82. (VALUES ('-1.'), ('-1.kb'), ('-1. kb'), ('-0. gb'),
  83. ('-.1'), ('-.1kb'), ('-.1 kb'), ('-.0 gb')) x(size);
  84. </sql-statement>
  85. <sql-statement>
  86. -- invalid inputs
  87. SELECT pg_size_bytes('1 AB');
  88. </sql-statement>
  89. -stdin-:<main>: Fatal: Execution
  90. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  91. -- invalid inputs
  92. ^
  93. -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "1 AB"
  94. DETAIL: Invalid size unit: "AB".
  95. HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
  96. -- invalid inputs
  97. ^
  98. <sql-statement>
  99. SELECT pg_size_bytes('1 AB A');
  100. </sql-statement>
  101. -stdin-:<main>: Fatal: Execution
  102. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  103. SELECT pg_size_bytes('1 AB A');
  104. ^
  105. -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "1 AB A"
  106. DETAIL: Invalid size unit: "AB A".
  107. HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
  108. SELECT pg_size_bytes('1 AB A');
  109. ^
  110. <sql-statement>
  111. SELECT pg_size_bytes('1 AB A ');
  112. </sql-statement>
  113. -stdin-:<main>: Fatal: Execution
  114. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  115. SELECT pg_size_bytes('1 AB A ');
  116. ^
  117. -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "1 AB A "
  118. DETAIL: Invalid size unit: "AB A".
  119. HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
  120. SELECT pg_size_bytes('1 AB A ');
  121. ^
  122. <sql-statement>
  123. SELECT pg_size_bytes('9223372036854775807.9');
  124. </sql-statement>
  125. -stdin-:<main>: Fatal: Execution
  126. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  127. SELECT pg_size_bytes('9223372036854775807.9');
  128. ^
  129. -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
  130. SELECT pg_size_bytes('9223372036854775807.9');
  131. ^
  132. <sql-statement>
  133. SELECT pg_size_bytes('1e100');
  134. </sql-statement>
  135. -stdin-:<main>: Fatal: Execution
  136. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  137. SELECT pg_size_bytes('1e100');
  138. ^
  139. -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
  140. SELECT pg_size_bytes('1e100');
  141. ^
  142. <sql-statement>
  143. SELECT pg_size_bytes('1e1000000000000000000');
  144. </sql-statement>
  145. -stdin-:<main>: Fatal: Execution
  146. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  147. SELECT pg_size_bytes('1e1000000000000000000');
  148. ^
  149. -stdin-:<main>:1:1: Fatal: ERROR: value overflows numeric format
  150. SELECT pg_size_bytes('1e1000000000000000000');
  151. ^
  152. <sql-statement>
  153. SELECT pg_size_bytes('1 byte'); -- the singular "byte" is not supported
  154. </sql-statement>
  155. -stdin-:<main>: Fatal: Execution
  156. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  157. SELECT pg_size_bytes('1 byte'); -- the singular "byte" is not supported
  158. ^
  159. -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "1 byte"
  160. DETAIL: Invalid size unit: "byte".
  161. HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
  162. SELECT pg_size_bytes('1 byte'); -- the singular "byte" is not supported
  163. ^
  164. <sql-statement>
  165. SELECT pg_size_bytes('');
  166. </sql-statement>
  167. -stdin-:<main>: Fatal: Execution
  168. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  169. SELECT pg_size_bytes('');
  170. ^
  171. -stdin-:<main>:1:1: Fatal: ERROR: invalid size: ""
  172. SELECT pg_size_bytes('');
  173. ^
  174. <sql-statement>
  175. SELECT pg_size_bytes('kb');
  176. </sql-statement>
  177. -stdin-:<main>: Fatal: Execution
  178. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  179. SELECT pg_size_bytes('kb');
  180. ^
  181. -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "kb"
  182. SELECT pg_size_bytes('kb');
  183. ^
  184. <sql-statement>
  185. SELECT pg_size_bytes('..');
  186. </sql-statement>
  187. -stdin-:<main>: Fatal: Execution
  188. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  189. SELECT pg_size_bytes('..');
  190. ^
  191. -stdin-:<main>:1:1: Fatal: ERROR: invalid size: ".."
  192. SELECT pg_size_bytes('..');
  193. ^
  194. <sql-statement>
  195. SELECT pg_size_bytes('-.');
  196. </sql-statement>
  197. -stdin-:<main>: Fatal: Execution
  198. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  199. SELECT pg_size_bytes('-.');
  200. ^
  201. -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "-."
  202. SELECT pg_size_bytes('-.');
  203. ^
  204. <sql-statement>
  205. SELECT pg_size_bytes('-.kb');
  206. </sql-statement>
  207. -stdin-:<main>: Fatal: Execution
  208. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  209. SELECT pg_size_bytes('-.kb');
  210. ^
  211. -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "-.kb"
  212. SELECT pg_size_bytes('-.kb');
  213. ^
  214. <sql-statement>
  215. SELECT pg_size_bytes('-. kb');
  216. </sql-statement>
  217. -stdin-:<main>: Fatal: Execution
  218. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  219. SELECT pg_size_bytes('-. kb');
  220. ^
  221. -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "-. kb"
  222. SELECT pg_size_bytes('-. kb');
  223. ^
  224. <sql-statement>
  225. SELECT pg_size_bytes('.+912');
  226. </sql-statement>
  227. -stdin-:<main>: Fatal: Execution
  228. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  229. SELECT pg_size_bytes('.+912');
  230. ^
  231. -stdin-:<main>:1:1: Fatal: ERROR: invalid size: ".+912"
  232. SELECT pg_size_bytes('.+912');
  233. ^
  234. <sql-statement>
  235. SELECT pg_size_bytes('+912+ kB');
  236. </sql-statement>
  237. -stdin-:<main>: Fatal: Execution
  238. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  239. SELECT pg_size_bytes('+912+ kB');
  240. ^
  241. -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "+912+ kB"
  242. DETAIL: Invalid size unit: "+ kB".
  243. HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
  244. SELECT pg_size_bytes('+912+ kB');
  245. ^
  246. <sql-statement>
  247. SELECT pg_size_bytes('++123 kB');
  248. </sql-statement>
  249. -stdin-:<main>: Fatal: Execution
  250. -stdin-:<main>:1:1: Fatal: Execution of node: Result
  251. SELECT pg_size_bytes('++123 kB');
  252. ^
  253. -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "++123 kB"
  254. SELECT pg_size_bytes('++123 kB');
  255. ^