postgres.git / summary / log / commit / refs
commit 26cd1d7d9513b2b490efc746551ec5a786b56212
Author: Bruce Momjian <bruce@momjian.us>
Date: Tue Apr 22 22:19:07 2014 +0000
docs: add results for JSON operator examples
Patch by Sehrope Sarkuni
doc/src/sgml/func.sgml | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 148f0bc2378..0c8fc67cc62 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -10099,6 +10099,7 @@ table2-mapping
<entry>Right Operand Type</entry>
<entry>Description</entry>
<entry>Example</entry>
+ <entry>Example Result</entry>
</row>
</thead>
<tbody>
@@ -10106,37 +10107,43 @@ table2-mapping
<entry><literal>-></literal></entry>
<entry>int</entry>
<entry>Get JSON array element</entry>
- <entry><literal>'[1,2,3]'::json->2</literal></entry>
+ <entry><literal>'[{"a":"foo"},{"a":"bar"},{"a":"baz"}]'::json->2</literal></entry>
+ <entry><literal>{"a":"baz"}</literal></entry>
</row>
<row>
<entry><literal>-></literal></entry>
<entry>text</entry>
<entry>Get JSON object field</entry>
- <entry><literal>'{"a":1,"b":2}'::json->'b'</literal></entry>
+ <entry><literal>'{"a": {"b":"foo"}}'::json->'a'</literal></entry>
+ <entry><literal>{"b":"foo"}</literal></entry>
</row>
<row>
<entry><literal>->></literal></entry>
<entry>int</entry>
<entry>Get JSON array element as text</entry>
<entry><literal>'[1,2,3]'::json->>2</literal></entry>
+ <entry><literal>3</literal></entry>
</row>
<row>
<entry><literal>->></literal></entry>
<entry>text</entry>
<entry>Get JSON object field as text</entry>
<entry><literal>'{"a":1,"b":2}'::json->>'b'</literal></entry>
+ <entry><literal>2</literal></entry>
</row>
<row>
<entry><literal>#></literal></entry>
<entry>text[]</entry>
- <entry>Get JSON object at specified path</entry>
- <entry><literal>'{"a":[1,2,3],"b":[4,5,6]}'::json#>'{a,2}'</literal></entry>
+ <entry>Get JSON object at specified path</entry>
+ <entry><literal>'{"a": {"b":{"c": "foo"}}}'::json#>'{a,b}'</literal></entry>
+ <entry><literal>{"c": "foo"}</literal></entry>
</row>
<row>
<entry><literal>#>></literal></entry>
<entry>text[]</entry>
<entry>Get JSON object at specified path as text</entry>
<entry><literal>'{"a":[1,2,3],"b":[4,5,6]}'::json#>>'{a,2}'</literal></entry>
+ <entry><literal>3</literal></entry>
</row>
</tbody>
</tgroup>
[parent: 19fa6161dd6b]