jsonb.td 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. # This test exercises JSONB at the boundary (e.g., by sending it through
  10. # pgwire). Operations on JSONB are more thoroughly tested in jsonb.slt.
  11. > VALUES
  12. ('1'::jsonb),
  13. ('1.0'::jsonb),
  14. ('["a", "b"]'::jsonb),
  15. ('{"c": ["d"]}'::jsonb),
  16. ('null'::jsonb),
  17. (NULL::jsonb)
  18. "1"
  19. "1"
  20. "[\"a\",\"b\"]"
  21. "{\"c\":[\"d\"]}"
  22. "null"
  23. "<null>"
  24. # Show that we suggest using jsonb functions when presented with json functions
  25. ! SELECT json_build_object('id', 1)
  26. contains:exist
  27. hint:Try using jsonb_build_object
  28. ! SELECT json_agg(1)
  29. contains:exist
  30. hint:Try using jsonb_agg
  31. # This is the generic hint, showing we haven't populated it with the jsonb suggestion
  32. ! SELECT json_without_corresponding_jsonb(1)
  33. contains:exist
  34. hint:No function matches the given name and argument type