@@ -267,30 +267,30 @@ SELECT '{"reading": 1.230e-5}'::json, '{"reading": 1.230e-5}'::jsonb;
267
267
</para>
268
268
<programlisting>
269
269
-- Simple scalar/primitive values contain only the identical value:
270
- SELECT '"foo"'::jsonb @> '"foo"'::jsonb;
270
+ SELECT '"foo"'::jsonb @> '"foo"'::jsonb;
271
271
272
272
-- The array on the right side is contained within the one on the left:
273
- SELECT '[1, 2, 3]'::jsonb @> '[1, 3]'::jsonb;
273
+ SELECT '[1, 2, 3]'::jsonb @> '[1, 3]'::jsonb;
274
274
275
275
-- Order of array elements is not significant, so this is also true:
276
- SELECT '[1, 2, 3]'::jsonb @> '[3, 1]'::jsonb;
276
+ SELECT '[1, 2, 3]'::jsonb @> '[3, 1]'::jsonb;
277
277
278
278
-- Duplicate array elements don't matter either:
279
- SELECT '[1, 2, 3]'::jsonb @> '[1, 2, 2]'::jsonb;
279
+ SELECT '[1, 2, 3]'::jsonb @> '[1, 2, 2]'::jsonb;
280
280
281
281
-- The object with a single pair on the right side is contained
282
282
-- within the object on the left side:
283
- SELECT '{"product": "PostgreSQL", "version": 9.4, "jsonb":true}'::jsonb @> '{"version":9.4}'::jsonb;
283
+ SELECT '{"product": "PostgreSQL", "version": 9.4, "jsonb":true}'::jsonb @> '{"version":9.4}'::jsonb;
284
284
285
285
-- The array on the right side is <emphasis>not</> considered contained within the
286
286
-- array on the left, even though a similar array is nested within it:
287
- SELECT '[1, 2, [1, 3]]'::jsonb @> '[1, 3]'::jsonb; -- yields false
287
+ SELECT '[1, 2, [1, 3]]'::jsonb @> '[1, 3]'::jsonb; -- yields false
288
288
289
289
-- But with a layer of nesting, it is contained:
290
- SELECT '[1, 2, [1, 3]]'::jsonb @> '[[1, 3]]'::jsonb;
290
+ SELECT '[1, 2, [1, 3]]'::jsonb @> '[[1, 3]]'::jsonb;
291
291
292
292
-- Similarly, containment is not reported here:
293
- SELECT '{"foo": {"bar": "baz"}}'::jsonb @> '{"bar": "baz"}'::jsonb; -- yields false
293
+ SELECT '{"foo": {"bar": "baz"}}'::jsonb @> '{"bar": "baz"}'::jsonb; -- yields false
294
294
</programlisting>
295
295
296
296
<para>
@@ -309,10 +309,10 @@ SELECT '{"foo": {"bar": "baz"}}'::jsonb @> '{"bar": "baz"}'::jsonb; -- yields f
309
309
</para>
310
310
<programlisting>
311
311
-- This array contains the primitive string value:
312
- SELECT '["foo", "bar"]'::jsonb @> '"bar"'::jsonb;
312
+ SELECT '["foo", "bar"]'::jsonb @> '"bar"'::jsonb;
313
313
314
314
-- This exception is not reciprocal -- non-containment is reported here:
315
- SELECT '"bar"'::jsonb @> '["bar"]'::jsonb; -- yields false
315
+ SELECT '"bar"'::jsonb @> '["bar"]'::jsonb; -- yields false
316
316
</programlisting>
317
317
318
318
<para>
0 commit comments