From f870d8dc6a47f3e15132c9c809a74cac37374cfa Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 3 Oct 2020 23:41:35 -0500
Subject: [PATCH v3 04/12] Add spaces after commas in function calls..

..especially quoted arguments.

I think that's clearer and more conventional: f(a, b).
However, I don't think it's useful to add commas indiscriminantly, so these
aren't always changed: f(a, g(b,c)).

See also: 9436041ed848debb3d64fb5fbff6cdb35bc46d04 (jsonb_set_lax)
---
 doc/src/sgml/dblink.sgml     |  8 ++++----
 doc/src/sgml/func.sgml       | 30 +++++++++++++++---------------
 doc/src/sgml/hstore.sgml     | 10 +++++-----
 doc/src/sgml/ltree.sgml      | 12 ++++++------
 doc/src/sgml/textsearch.sgml | 30 +++++++++++++++---------------
 5 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/doc/src/sgml/dblink.sgml b/doc/src/sgml/dblink.sgml
index eba7fcfb98..bcf623117c 100644
--- a/doc/src/sgml/dblink.sgml
+++ b/doc/src/sgml/dblink.sgml
@@ -166,7 +166,7 @@ SELECT dblink_connect('myconn', 'fdtest');
  OK
 (1 row)
 
-SELECT * FROM dblink('myconn','SELECT * FROM foo') AS t(a int, b text, c text[]);
+SELECT * FROM dblink('myconn', 'SELECT * FROM foo') AS t(a int, b text, c text[]);
  a  | b |       c       
 ----+---+---------------
   0 | a | {a0,b0,c0}
@@ -615,7 +615,7 @@ dblink_exec(text sql [, bool fail_on_error]) returns text
       <para>
        The SQL command that you wish to execute in the remote database,
        for example
-       <literal>insert into foo values(0,'a','{"a0","b0","c0"}')</literal>.
+       <literal>insert into foo values(0, 'a', '{"a0","b0","c0"}')</literal>.
       </para>
      </listitem>
     </varlistentry>
@@ -652,7 +652,7 @@ SELECT dblink_connect('dbname=dblink_test_standby');
  OK
 (1 row)
 
-SELECT dblink_exec('insert into foo values(21,''z'',''{"a0","b0","c0"}'');');
+SELECT dblink_exec('insert into foo values(21, ''z'', ''{"a0","b0","c0"}'');');
    dblink_exec
 -----------------
  INSERT 943366 1
@@ -664,7 +664,7 @@ SELECT dblink_connect('myconn', 'dbname=regression');
  OK
 (1 row)
 
-SELECT dblink_exec('myconn', 'insert into foo values(21,''z'',''{"a0","b0","c0"}'');');
+SELECT dblink_exec('myconn', 'insert into foo values(21, ''z'', ''{"a0","b0","c0"}'');');
    dblink_exec
 ------------------
  INSERT 6432584 1
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 8082fddf8c..6a937515b5 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -15032,7 +15032,7 @@ table2-mapping
         per <function>to_json</function> or <function>to_jsonb</function>.
        </para>
        <para>
-        <literal>json_build_array(1,2,'foo',4,5)</literal>
+        <literal>json_build_array(1, 2, 'foo', 4, 5)</literal>
         <returnvalue>[1, 2, "foo", 4, 5]</returnvalue>
        </para></entry>
       </row>
@@ -15059,7 +15059,7 @@ table2-mapping
         per <function>to_json</function> or <function>to_jsonb</function>.
        </para>
        <para>
-        <literal>json_build_object('foo',1,2,row(3,'bar'))</literal>
+        <literal>json_build_object('foo', 1, 2, row(3,'bar'))</literal>
         <returnvalue>{"foo" : 1, "2" : {"f1":3,"f2":"bar"}}</returnvalue>
        </para></entry>
       </row>
@@ -15091,7 +15091,7 @@ table2-mapping
         <literal>json_object('{a, 1, b, "def", c, 3.5}')</literal>
         <returnvalue>{"a" : "1", "b" : "def", "c" : "3.5"}</returnvalue>
        </para>
-        <para><literal>json_object('{{a, 1},{b, "def"},{c, 3.5}}')</literal>
+        <para><literal>json_object('{{a, 1}, {b, "def"}, {c, 3.5}}')</literal>
         <returnvalue>{"a" : "1", "b" : "def", "c" : "3.5"}</returnvalue>
        </para></entry>
       </row>
@@ -15111,7 +15111,7 @@ table2-mapping
         the one-argument form.
        </para>
        <para>
-        <literal>json_object('{a, b}', '{1,2}')</literal>
+        <literal>json_object('{a,b}', '{1,2}')</literal>
         <returnvalue>{"a": "1", "b": "2"}</returnvalue>
        </para></entry>
       </row>
@@ -15502,7 +15502,7 @@ table2-mapping
         <literal>create type twoints as (a int, b int);</literal>
        </para>
        <para>
-        <literal>select * from json_populate_recordset(null::twoints, '[{"a":1,"b":2},{"a":3,"b":4}]')</literal>
+        <literal>select * from json_populate_recordset(null::twoints, '[{"a":1,"b":2}, {"a":3,"b":4}]')</literal>
         <returnvalue></returnvalue>
 <programlisting>
  a | b
@@ -15577,7 +15577,7 @@ table2-mapping
         for <function>json[b]_populate_record</function>.
        </para>
        <para>
-        <literal>select * from json_to_recordset('[{"a":1,"b":"foo"},{"a":"2","c":"bar"}]') as x(a int, b text)</literal>
+        <literal>select * from json_to_recordset('[{"a":1,"b":"foo"}, {"a":"2","c":"bar"}]') as x(a int, b text)</literal>
         <returnvalue></returnvalue>
 <programlisting>
  a |  b
@@ -15615,11 +15615,11 @@ table2-mapping
         or at the end of the array if it is positive.
        </para>
        <para>
-        <literal>jsonb_set('[{"f1":1,"f2":null},2,null,3]', '{0,f1}','[2,3,4]', false)</literal>
+        <literal>jsonb_set('[{"f1":1,"f2":null},2,null,3]', '{0,f1}', '[2,3,4]', false)</literal>
         <returnvalue>[{"f1": [2, 3, 4], "f2": null}, 2, null, 3]</returnvalue>
        </para>
        <para>
-        <literal>jsonb_set('[{"f1":1,"f2":null},2]', '{0,f3}','[2,3,4]')</literal>
+        <literal>jsonb_set('[{"f1":1,"f2":null},2]', '{0,f3}', '[2,3,4]')</literal>
         <returnvalue>[{"f1": 1, "f2": null, "f3": [2, 3, 4]}, 2]</returnvalue>
        </para></entry>
       </row>
@@ -15711,7 +15711,7 @@ table2-mapping
         untouched.
        </para>
        <para>
-        <literal>json_strip_nulls('[{"f1":1,"f2":null},2,null,3]')</literal>
+        <literal>json_strip_nulls('[{"f1":1, "f2":null}, 2, null, 3]')</literal>
         <returnvalue>[{"f1":1},2,null,3]</returnvalue>
        </para></entry>
       </row>
@@ -15735,7 +15735,7 @@ table2-mapping
         as the <literal>@?</literal> and <literal>@@</literal> operators do.
        </para>
        <para>
-        <literal>jsonb_path_exists('{"a":[1,2,3,4,5]}', '$.a[*] ? (@ >= $min &amp;&amp; @ &lt;= $max)', '{"min":2,"max":4}')</literal>
+        <literal>jsonb_path_exists('{"a":[1,2,3,4,5]}', '$.a[*] ? (@ >= $min &amp;&amp; @ &lt;= $max)', '{"min":2, "max":4}')</literal>
         <returnvalue>t</returnvalue>
        </para></entry>
       </row>
@@ -15757,7 +15757,7 @@ table2-mapping
         for <function>jsonb_path_exists</function>.
        </para>
        <para>
-        <literal>jsonb_path_match('{"a":[1,2,3,4,5]}', 'exists($.a[*] ? (@ >= $min &amp;&amp; @ &lt;= $max))', '{"min":2,"max":4}')</literal>
+        <literal>jsonb_path_match('{"a":[1,2,3,4,5]}', 'exists($.a[*] ? (@ >= $min &amp;&amp; @ &lt;= $max))', '{"min":2, "max":4}')</literal>
         <returnvalue>t</returnvalue>
        </para></entry>
       </row>
@@ -15778,7 +15778,7 @@ table2-mapping
         for <function>jsonb_path_exists</function>.
        </para>
        <para>
-        <literal>select * from jsonb_path_query('{"a":[1,2,3,4,5]}', '$.a[*] ? (@ >= $min &amp;&amp; @ &lt;= $max)', '{"min":2,"max":4}')</literal>
+        <literal>select * from jsonb_path_query('{"a":[1,2,3,4,5]}', '$.a[*] ? (@ >= $min &amp;&amp; @ &lt;= $max)', '{"min":2, "max":4}')</literal>
         <returnvalue></returnvalue>
 <programlisting>
  jsonb_path_query
@@ -15806,7 +15806,7 @@ table2-mapping
         for <function>jsonb_path_exists</function>.
        </para>
        <para>
-        <literal>jsonb_path_query_array('{"a":[1,2,3,4,5]}', '$.a[*] ? (@ >= $min &amp;&amp; @ &lt;= $max)', '{"min":2,"max":4}')</literal>
+        <literal>jsonb_path_query_array('{"a":[1,2,3,4,5]}', '$.a[*] ? (@ >= $min &amp;&amp; @ &lt;= $max)', '{"min":2, "max":4}')</literal>
         <returnvalue>[2, 3, 4]</returnvalue>
        </para></entry>
       </row>
@@ -15828,7 +15828,7 @@ table2-mapping
         for <function>jsonb_path_exists</function>.
        </para>
        <para>
-        <literal>jsonb_path_query_first('{"a":[1,2,3,4,5]}', '$.a[*] ? (@ >= $min &amp;&amp; @ &lt;= $max)', '{"min":2,"max":4}')</literal>
+        <literal>jsonb_path_query_first('{"a":[1,2,3,4,5]}', '$.a[*] ? (@ >= $min &amp;&amp; @ &lt;= $max)', '{"min":2, "max":4}')</literal>
         <returnvalue>2</returnvalue>
        </para></entry>
       </row>
@@ -15900,7 +15900,7 @@ table2-mapping
         Converts the given JSON value to pretty-printed, indented text.
        </para>
        <para>
-        <literal>jsonb_pretty('[{"f1":1,"f2":null},2]')</literal>
+        <literal>jsonb_pretty('[{"f1":1,"f2":null}, 2]')</literal>
         <returnvalue></returnvalue>
 <programlisting>
 [
diff --git a/doc/src/sgml/hstore.sgml b/doc/src/sgml/hstore.sgml
index 8a1caa3576..14a36ade00 100644
--- a/doc/src/sgml/hstore.sgml
+++ b/doc/src/sgml/hstore.sgml
@@ -631,7 +631,7 @@ b
         Does <type>hstore</type> contain key?
        </para>
        <para>
-        <literal>exist('a=&gt;1','a')</literal>
+        <literal>exist('a=&gt;1', 'a')</literal>
         <returnvalue>t</returnvalue>
        </para></entry>
       </row>
@@ -647,7 +647,7 @@ b
         for key?
        </para>
        <para>
-        <literal>defined('a=&gt;NULL','a')</literal>
+        <literal>defined('a=&gt;NULL', 'a')</literal>
         <returnvalue>f</returnvalue>
        </para></entry>
       </row>
@@ -662,7 +662,7 @@ b
         Deletes pair with matching key.
        </para>
        <para>
-        <literal>delete('a=&gt;1,b=&gt;2','b')</literal>
+        <literal>delete('a=&gt;1,b=&gt;2', 'b')</literal>
         <returnvalue>"a"=&gt;"1"</returnvalue>
        </para></entry>
       </row>
@@ -676,7 +676,7 @@ b
         Deletes pairs with matching keys.
        </para>
        <para>
-        <literal>delete('a=&gt;1,b=&gt;2,c=&gt;3',ARRAY['a','b'])</literal>
+        <literal>delete('a=&gt;1,b=&gt;2,c=&gt;3', ARRAY['a','b'])</literal>
         <returnvalue>"c"=&gt;"3"</returnvalue>
        </para></entry>
       </row>
@@ -690,7 +690,7 @@ b
         Deletes pairs matching those in the second argument.
        </para>
        <para>
-        <literal>delete('a=&gt;1,b=&gt;2','a=&gt;4,b=&gt;2'::hstore)</literal>
+        <literal>delete('a=&gt;1,b=&gt;2', 'a=&gt;4,b=&gt;2'::hstore)</literal>
         <returnvalue>"a"=&gt;"1"</returnvalue>
        </para></entry>
       </row>
diff --git a/doc/src/sgml/ltree.sgml b/doc/src/sgml/ltree.sgml
index 36aa2b5fad..06a983c075 100644
--- a/doc/src/sgml/ltree.sgml
+++ b/doc/src/sgml/ltree.sgml
@@ -460,7 +460,7 @@ Europe &amp; Russia*@ &amp; !Transportation
         position <parameter>end</parameter>-1 (counting from 0).
        </para>
        <para>
-        <literal>subltree('Top.Child1.Child2',1,2)</literal>
+        <literal>subltree('Top.Child1.Child2', 1, 2)</literal>
         <returnvalue>Child1</returnvalue>
        </para></entry>
       </row>
@@ -480,7 +480,7 @@ Europe &amp; Russia*@ &amp; !Transportation
         the end of the path.
        </para>
        <para>
-        <literal>subpath('Top.Child1.Child2',0,2)</literal>
+        <literal>subpath('Top.Child1.Child2', 0, 2)</literal>
         <returnvalue>Top.Child1</returnvalue>
        </para></entry>
       </row>
@@ -497,7 +497,7 @@ Europe &amp; Russia*@ &amp; !Transportation
         from the end of the path.
        </para>
        <para>
-        <literal>subpath('Top.Child1.Child2',1)</literal>
+        <literal>subpath('Top.Child1.Child2', 1)</literal>
         <returnvalue>Child1.Child2</returnvalue>
        </para></entry>
       </row>
@@ -528,7 +528,7 @@ Europe &amp; Russia*@ &amp; !Transportation
         <parameter>a</parameter>, or -1 if not found.
        </para>
        <para>
-        <literal>index('0.1.2.3.5.4.5.6.8.5.6.8','5.6')</literal>
+        <literal>index('0.1.2.3.5.4.5.6.8.5.6.8', '5.6')</literal>
         <returnvalue>6</returnvalue>
        </para></entry>
       </row>
@@ -546,7 +546,7 @@ Europe &amp; Russia*@ &amp; !Transportation
         start <parameter>-offset</parameter> labels from the end of the path.
        </para>
        <para>
-        <literal>index('0.1.2.3.5.4.5.6.8.5.6.8','5.6',-4)</literal>
+        <literal>index('0.1.2.3.5.4.5.6.8.5.6.8', '5.6', -4)</literal>
         <returnvalue>9</returnvalue>
        </para></entry>
       </row>
@@ -584,7 +584,7 @@ Europe &amp; Russia*@ &amp; !Transportation
         (up to 8 arguments are supported).
        </para>
        <para>
-        <literal>lca('1.2.3','1.2.3.4.5.6')</literal>
+        <literal>lca('1.2.3', '1.2.3.4.5.6')</literal>
         <returnvalue>1.2</returnvalue>
        </para></entry>
       </row>
diff --git a/doc/src/sgml/textsearch.sgml b/doc/src/sgml/textsearch.sgml
index 2ebdf02bfa..f4433b5c1f 100644
--- a/doc/src/sgml/textsearch.sgml
+++ b/doc/src/sgml/textsearch.sgml
@@ -2419,7 +2419,7 @@ ALTER TEXT SEARCH CONFIGURATION astro_en
     positions in <type>tsvector</type>, which in turn affect ranking:
 
 <screen>
-SELECT to_tsvector('english','in the list of stop words');
+SELECT to_tsvector('english', 'in the list of stop words');
         to_tsvector
 ----------------------------
  'list':3 'stop':5 'word':6
@@ -2429,12 +2429,12 @@ SELECT to_tsvector('english','in the list of stop words');
     calculated for documents with and without stop words are quite different:
 
 <screen>
-SELECT ts_rank_cd (to_tsvector('english','in the list of stop words'), to_tsquery('list &amp; stop'));
+SELECT ts_rank_cd (to_tsvector('english', 'in the list of stop words'), to_tsquery('list &amp; stop'));
  ts_rank_cd
 ------------
        0.05
 
-SELECT ts_rank_cd (to_tsvector('english','list stop words'), to_tsquery('list &amp; stop'));
+SELECT ts_rank_cd (to_tsvector('english', 'list stop words'), to_tsquery('list &amp; stop'));
  ts_rank_cd
 ------------
         0.1
@@ -2493,12 +2493,12 @@ CREATE TEXT SEARCH DICTIONARY public.simple_dict (
     Now we can test our dictionary:
 
 <screen>
-SELECT ts_lexize('public.simple_dict','YeS');
+SELECT ts_lexize('public.simple_dict', 'YeS');
  ts_lexize
 -----------
  {yes}
 
-SELECT ts_lexize('public.simple_dict','The');
+SELECT ts_lexize('public.simple_dict', 'The');
  ts_lexize
 -----------
  {}
@@ -2514,12 +2514,12 @@ SELECT ts_lexize('public.simple_dict','The');
 <screen>
 ALTER TEXT SEARCH DICTIONARY public.simple_dict ( Accept = false );
 
-SELECT ts_lexize('public.simple_dict','YeS');
+SELECT ts_lexize('public.simple_dict', 'YeS');
  ts_lexize
 -----------
 
 
-SELECT ts_lexize('public.simple_dict','The');
+SELECT ts_lexize('public.simple_dict', 'The');
  ts_lexize
 -----------
  {}
@@ -2633,7 +2633,7 @@ indices index*
     Then we will get these results:
 <screen>
 mydb=# CREATE TEXT SEARCH DICTIONARY syn (template=synonym, synonyms='synonym_sample');
-mydb=# SELECT ts_lexize('syn','indices');
+mydb=# SELECT ts_lexize('syn', 'indices');
  ts_lexize
 -----------
  {index}
@@ -2641,13 +2641,13 @@ mydb=# SELECT ts_lexize('syn','indices');
 
 mydb=# CREATE TEXT SEARCH CONFIGURATION tst (copy=simple);
 mydb=# ALTER TEXT SEARCH CONFIGURATION tst ALTER MAPPING FOR asciiword WITH syn;
-mydb=# SELECT to_tsvector('tst','indices');
+mydb=# SELECT to_tsvector('tst', 'indices');
  to_tsvector
 -------------
  'index':1
 (1 row)
 
-mydb=# SELECT to_tsquery('tst','indices');
+mydb=# SELECT to_tsquery('tst', 'indices');
  to_tsquery
 ------------
  'index':*
@@ -2659,7 +2659,7 @@ mydb=# SELECT 'indexes are very useful'::tsvector;
  'are' 'indexes' 'useful' 'very'
 (1 row)
 
-mydb=# SELECT 'indexes are very useful'::tsvector @@ to_tsquery('tst','indices');
+mydb=# SELECT 'indexes are very useful'::tsvector @@ to_tsquery('tst', 'indices');
  ?column?
 ----------
  t
@@ -3354,7 +3354,7 @@ ts_debug(<optional> <replaceable class="parameter">config</replaceable> <type>re
    Here is a simple example:
 
 <screen>
-SELECT * FROM ts_debug('english','a fat  cat sat on a mat - it ate a fat rats');
+SELECT * FROM ts_debug('english', 'a fat  cat sat on a mat - it ate a fat rats');
    alias   |   description   | token |  dictionaries  |  dictionary  | lexemes 
 -----------+-----------------+-------+----------------+--------------+---------
  asciiword | Word, all ASCII | a     | {english_stem} | english_stem | {}
@@ -3405,7 +3405,7 @@ ALTER TEXT SEARCH CONFIGURATION public.english
 </programlisting>
 
 <screen>
-SELECT * FROM ts_debug('public.english','The Brightest supernovaes');
+SELECT * FROM ts_debug('public.english', 'The Brightest supernovaes');
    alias   |   description   |    token    |         dictionaries          |   dictionary   |   lexemes   
 -----------+-----------------+-------------+-------------------------------+----------------+-------------
  asciiword | Word, all ASCII | The         | {english_ispell,english_stem} | english_ispell | {}
@@ -3444,7 +3444,7 @@ SELECT * FROM ts_debug('public.english','The Brightest supernovaes');
 
 <screen>
 SELECT alias, token, dictionary, lexemes
-FROM ts_debug('public.english','The Brightest supernovaes');
+FROM ts_debug('public.english', 'The Brightest supernovaes');
    alias   |    token    |   dictionary   |   lexemes   
 -----------+-------------+----------------+-------------
  asciiword | The         | english_ispell | {}
@@ -3592,7 +3592,7 @@ SELECT ts_lexize('english_stem', 'a');
      where this can be confusing:
 
 <screen>
-SELECT ts_lexize('thesaurus_astro','supernovae stars') is null;
+SELECT ts_lexize('thesaurus_astro', 'supernovae stars') is null;
  ?column?
 ----------
  t
-- 
2.17.0

