From df3d19b401943758577bf939b07b9f338fc81ff3 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sun, 19 Jul 2020 13:24:42 -0500 Subject: [PATCH 8/9] fix! Subscripting documentation --- doc/src/sgml/json.sgml | 6 +++--- doc/src/sgml/ref/create_type.sgml | 2 +- doc/src/sgml/xsubscripting.sgml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/src/sgml/json.sgml b/doc/src/sgml/json.sgml index 3bffe8049b..5c538dca05 100644 --- a/doc/src/sgml/json.sgml +++ b/doc/src/sgml/json.sgml @@ -606,8 +606,8 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @> '{"tags": ["qu <type>jsonb</type> Subscripting jsonb data type supports array-style subscripting expressions - to extract or update particular element. It's possible to use multiple - subscripting expressions to extract nested values. In this case a chain of + to extract or update particular elements. It's possible to use multiple + subscripting expressions to extract nested values. In this case, a chain of subscripting expressions follows the same rules as the path argument in jsonb_set function, e.g. in case of arrays it is a 0-based operation or that negative integers @@ -634,7 +634,7 @@ SELECT * FROM table_name WHERE jsonb_field['key'] = '"value"'; There is no special indexing support for such kind of expressions, but you - always can create a functional index that includes it + can always create a functional index that includes it CREATE INDEX idx ON table_name ((jsonb_field['key'])); diff --git a/doc/src/sgml/ref/create_type.sgml b/doc/src/sgml/ref/create_type.sgml index ec67761c66..a34df4d247 100644 --- a/doc/src/sgml/ref/create_type.sgml +++ b/doc/src/sgml/ref/create_type.sgml @@ -470,7 +470,7 @@ CREATE TYPE name and jsonb (jsonb_subscripting_handler) types in src/backend/utils/adt/arrayfuncs.c and - src/backend/utils/adt/jsonfuncs.c corresponding. + src/backend/utils/adt/jsonfuncs.c, respectively. diff --git a/doc/src/sgml/xsubscripting.sgml b/doc/src/sgml/xsubscripting.sgml index d701631223..7224e81fa2 100644 --- a/doc/src/sgml/xsubscripting.sgml +++ b/doc/src/sgml/xsubscripting.sgml @@ -7,8 +7,8 @@ custom subscripting - When you define a new base type, you can also specify a custom procedures to - handle subscripting expressions. They must contain logic for verification and + When you define a new base type, you can also specify a custom procedure to + handle subscripting expressions. It must contain logic for verification and evaluation of this expression, i.e. fetching or updating some data in this data type. For instance: @@ -63,12 +63,12 @@ custom_subscript_assign(Datum containerSource, SubscriptingRefState *sbstate) Datum custom_subscript_fetch(Datum containerSource, SubscriptingRefState *sbstate) { - // Some fetch logic based on sbsdata + // Some fetch logic based on sbstate }]]> - Then you can define a subscripting procedures and a custom data type: + Then you can define a subscripting procedure and a custom data type: CREATE FUNCTION custom_subscripting_handler(internal) -- 2.17.0