create-in-v0.27.0-json.td 756 B

123456789101112131415161718
  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. #
  10. # Make sure that any JSON operators in views are properly persisted
  11. #
  12. > CREATE CLUSTER json_compute_cluster SIZE '1';
  13. > CREATE TABLE json_table (a JSONB);
  14. > CREATE MATERIALIZED VIEW json_view IN CLUSTER json_compute_cluster AS SELECT a->1 c1, a->>'b' c2, a #> '{b,1}' c3, a #>> '{b, 1}' c4, a - 'b' c5, a @> '{b, 1}' c6, a <@ '{b, 1}'::jsonb c7, a ? 'b' c8 FROM json_table;