Subject: JSON doc problem

From: Bruce Momjian <[email-masked]>
Date: Sat, 21 Jun 2014 00:18:44 -0400

There seems to be a problem in this 9.4 JSON doc paragraph in json.sgml:

    The technical difference between a <literal>jsonb_ops</literal>
    and a <literal>jsonb_path_ops</literal> GIN index is that the former
    creates independent index items for each key and value in the data,
    while the latter creates index items only for each value in the
    data.<footnote><para>For this purpose, the term <quote>value</>
    includes array elements, though JSON terminology sometimes considers
    array elements distinct from values within objects.</para></footnote>
--> But in <literal>jsonb_path_ops</literal>, each index item is a hash
    of both the value and the key(s) leading to it; for example to index
    <literal>{"foo": {"bar": "baz"}}</literal>, a single index item would
    be created incorporating all three of <literal>foo</>, <literal>bar</>,

What does this "But" refer to, and it is consistent with the sentences above?

-- 
  Bruce Momjian  <[email-masked]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +

-- 
Sent via pgsql-docs mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

---

From: Tom Lane <[email-masked]>
Date: Sat, 21 Jun 2014 11:32:40 -0400

> What does this "But" refer to, and it is consistent with the sentences above?

Hmm.  Probably "Also" or "Moreover" would work there.  I think this might
be leftover from a previous version of the paragraph --- I recall having
rewritten that several times before I was satisfied with it.

			regards, tom lane

---

From: Bruce Momjian <[email-masked]>
Date: Sat, 21 Jun 2014 15:32:20 -0400

> rewritten that several times before I was satisfied with it.

Thanks.  I have adjusted it with the attached, applied patch.

  + Everyone has their own god. +
diff --git a/doc/src/sgml/json.sgml b/doc/src/sgml/json.sgml
new file mode 100644
index 6642618..d55a08f
*** a/doc/src/sgml/json.sgml
--- b/doc/src/sgml/json.sgml
*************** SELECT jdoc-&gt;'guid', jdoc-&gt;'name'
*** 460,470 ****
      and a <literal>jsonb_path_ops</literal> GIN index is that the former
      creates independent index items for each key and value in the data,
      while the latter creates index items only for each value in the
!     data.<footnote><para>For this purpose, the term <quote>value</>
!     includes array elements, though JSON terminology sometimes considers
!     array elements distinct from values within objects.</para></footnote>
!     But in <literal>jsonb_path_ops</literal>, each index item is a hash
!     of both the value and the key(s) leading to it; for example to index
      <literal>{"foo": {"bar": "baz"}}</literal>, a single index item would
      be created incorporating all three of <literal>foo</>, <literal>bar</>,
      and <literal>baz</> into the hash value.  Thus a containment query
--- 460,475 ----
      and a <literal>jsonb_path_ops</literal> GIN index is that the former
      creates independent index items for each key and value in the data,
      while the latter creates index items only for each value in the
!     data.  
!     <footnote>
!      <para>
!       For this purpose, the term <quote>value</> includes array elements,
!       though JSON terminology sometimes considers array elements distinct
!       from values within objects.
!      </para>
!     </footnote>
!     Basically, each <literal>jsonb_path_ops</literal> index item is
!     a hash of the value and the key(s) leading to it; for example to index
      <literal>{"foo": {"bar": "baz"}}</literal>, a single index item would
      be created incorporating all three of <literal>foo</>, <literal>bar</>,
      and <literal>baz</> into the hash value.  Thus a containment query