Misc documentation fixes.

- Misc grammar and punctuation fixes.

- Stylistic cleanup: use spaces between function arguments and JSON fields
  in examples. For example "foo(a,b)" -> "foo(a, b)". Add semicolon after
  last END in a few PL/pgSQL examples that were missing them.

- Make sentence that talked about "..." and ".." operators more clear,
  by avoiding to end the sentence with "..". That makes it look the same
  as "..."

- Fix syntax description for HAVING: HAVING conditions cannot be repeated

Patch by Justin Pryzby, per Yaroslav Schekin's report. Backpatch to all
supported versions, to the extent that the patch applies easily.

Discussion: https://www.postgresql.org/message-id/20201005191922.GE17626%40telsasoft.com
This commit is contained in:
Heikki Linnakangas 2020-10-19 19:28:54 +03:00
parent 3b5bf7b893
commit 33acc6bc87
19 changed files with 69 additions and 69 deletions

View File

@ -1523,7 +1523,7 @@
</para> </para>
<para> <para>
Role can log in. That is, this role can be given as the initial Role can log in. That is, this role can be given as the initial
session authorization identifier session authorization identifier.
</para></entry> </para></entry>
</row> </row>

View File

@ -10108,8 +10108,8 @@ LOG: CleanUpLock: deleting: lock(0xb7acd844) id(24688,24696,0,0,0,1)
</term> </term>
<listitem> <listitem>
<para> <para>
If set, do not trace locks for tables below this OID. (use to avoid If set, do not trace locks for tables below this OID (used to avoid
output on system tables) output on system tables).
</para> </para>
<para> <para>
This parameter is only available if the <symbol>LOCK_DEBUG</symbol> This parameter is only available if the <symbol>LOCK_DEBUG</symbol>

View File

@ -166,7 +166,7 @@ SELECT dblink_connect('myconn', 'fdtest');
OK OK
(1 row) (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 a | b | c
----+---+--------------- ----+---+---------------
0 | a | {a0,b0,c0} 0 | a | {a0,b0,c0}
@ -615,7 +615,7 @@ dblink_exec(text sql [, bool fail_on_error]) returns text
<para> <para>
The SQL command that you wish to execute in the remote database, The SQL command that you wish to execute in the remote database,
for example 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> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -652,7 +652,7 @@ SELECT dblink_connect('dbname=dblink_test_standby');
OK OK
(1 row) (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 dblink_exec
----------------- -----------------
INSERT 943366 1 INSERT 943366 1
@ -664,7 +664,7 @@ SELECT dblink_connect('myconn', 'dbname=regression');
OK OK
(1 row) (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 dblink_exec
------------------ ------------------
INSERT 6432584 1 INSERT 6432584 1

View File

@ -14987,7 +14987,7 @@ table2-mapping
per <function>to_json</function> or <function>to_jsonb</function>. per <function>to_json</function> or <function>to_jsonb</function>.
</para> </para>
<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> <returnvalue>[1, 2, "foo", 4, 5]</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -15014,7 +15014,7 @@ table2-mapping
per <function>to_json</function> or <function>to_jsonb</function>. per <function>to_json</function> or <function>to_jsonb</function>.
</para> </para>
<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> <returnvalue>{"foo" : 1, "2" : {"f1":3,"f2":"bar"}}</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -15046,7 +15046,7 @@ table2-mapping
<literal>json_object('{a, 1, b, "def", c, 3.5}')</literal> <literal>json_object('{a, 1, b, "def", c, 3.5}')</literal>
<returnvalue>{"a" : "1", "b" : "def", "c" : "3.5"}</returnvalue> <returnvalue>{"a" : "1", "b" : "def", "c" : "3.5"}</returnvalue>
</para> </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> <returnvalue>{"a" : "1", "b" : "def", "c" : "3.5"}</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -15066,7 +15066,7 @@ table2-mapping
the one-argument form. the one-argument form.
</para> </para>
<para> <para>
<literal>json_object('{a, b}', '{1,2}')</literal> <literal>json_object('{a,b}', '{1,2}')</literal>
<returnvalue>{"a": "1", "b": "2"}</returnvalue> <returnvalue>{"a": "1", "b": "2"}</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -15457,7 +15457,7 @@ table2-mapping
<literal>create type twoints as (a int, b int);</literal> <literal>create type twoints as (a int, b int);</literal>
</para> </para>
<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> <returnvalue></returnvalue>
<programlisting> <programlisting>
a | b a | b
@ -15532,7 +15532,7 @@ table2-mapping
for <function>json[b]_populate_record</function>. for <function>json[b]_populate_record</function>.
</para> </para>
<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> <returnvalue></returnvalue>
<programlisting> <programlisting>
a | b a | b
@ -15570,11 +15570,11 @@ table2-mapping
or at the end of the array if it is positive. or at the end of the array if it is positive.
</para> </para>
<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> <returnvalue>[{"f1": [2, 3, 4], "f2": null}, 2, null, 3]</returnvalue>
</para> </para>
<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> <returnvalue>[{"f1": 1, "f2": null, "f3": [2, 3, 4]}, 2]</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -15666,7 +15666,7 @@ table2-mapping
untouched. untouched.
</para> </para>
<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> <returnvalue>[{"f1":1},2,null,3]</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -15690,7 +15690,7 @@ table2-mapping
as the <literal>@?</literal> and <literal>@@</literal> operators do. as the <literal>@?</literal> and <literal>@@</literal> operators do.
</para> </para>
<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> <returnvalue>t</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -15712,7 +15712,7 @@ table2-mapping
for <function>jsonb_path_exists</function>. for <function>jsonb_path_exists</function>.
</para> </para>
<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> <returnvalue>t</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -15733,7 +15733,7 @@ table2-mapping
for <function>jsonb_path_exists</function>. for <function>jsonb_path_exists</function>.
</para> </para>
<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> <returnvalue></returnvalue>
<programlisting> <programlisting>
jsonb_path_query jsonb_path_query
@ -15761,7 +15761,7 @@ table2-mapping
for <function>jsonb_path_exists</function>. for <function>jsonb_path_exists</function>.
</para> </para>
<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> <returnvalue>[2, 3, 4]</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -15783,7 +15783,7 @@ table2-mapping
for <function>jsonb_path_exists</function>. for <function>jsonb_path_exists</function>.
</para> </para>
<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> <returnvalue>2</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -15855,7 +15855,7 @@ table2-mapping
Converts the given JSON value to pretty-printed, indented text. Converts the given JSON value to pretty-printed, indented text.
</para> </para>
<para> <para>
<literal>jsonb_pretty('[{"f1":1,"f2":null},2]')</literal> <literal>jsonb_pretty('[{"f1":1,"f2":null}, 2]')</literal>
<returnvalue></returnvalue> <returnvalue></returnvalue>
<programlisting> <programlisting>
[ [
@ -26549,7 +26549,7 @@ BEGIN
obj.object_name, obj.object_name,
obj.object_identity; obj.object_identity;
END LOOP; END LOOP;
END END;
$$; $$;
CREATE EVENT TRIGGER test_event_trigger_for_drops CREATE EVENT TRIGGER test_event_trigger_for_drops
ON sql_drop ON sql_drop

View File

@ -603,7 +603,7 @@
</para> </para>
<para> <para>
<varname>gin_pending_list_limit</varname> can be overridden for individual <varname>gin_pending_list_limit</varname> can be overridden for individual
GIN indexes by changing storage parameters, and which allows each GIN indexes by changing storage parameters, which allows each
GIN index to have its own cleanup threshold. GIN index to have its own cleanup threshold.
For example, it's possible to increase the threshold only for the GIN For example, it's possible to increase the threshold only for the GIN
index which can be updated heavily, and decrease it otherwise. index which can be updated heavily, and decrease it otherwise.

View File

@ -1505,7 +1505,7 @@ synchronous_standby_names = 'ANY 2 (s1, s2, s3)'
Note that in this mode, the server will apply WAL one file at a Note that in this mode, the server will apply WAL one file at a
time, so if you use the standby server for queries (see Hot Standby), time, so if you use the standby server for queries (see Hot Standby),
there is a delay between an action in the master and when the there is a delay between an action in the master and when the
action becomes visible in the standby, corresponding the time it takes action becomes visible in the standby, corresponding to the time it takes
to fill up the WAL file. <varname>archive_timeout</varname> can be used to make that delay to fill up the WAL file. <varname>archive_timeout</varname> can be used to make that delay
shorter. Also note that you can't combine streaming replication with shorter. Also note that you can't combine streaming replication with
this method. this method.

View File

@ -631,7 +631,7 @@ b
Does <type>hstore</type> contain key? Does <type>hstore</type> contain key?
</para> </para>
<para> <para>
<literal>exist('a=&gt;1','a')</literal> <literal>exist('a=&gt;1', 'a')</literal>
<returnvalue>t</returnvalue> <returnvalue>t</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -647,7 +647,7 @@ b
for key? for key?
</para> </para>
<para> <para>
<literal>defined('a=&gt;NULL','a')</literal> <literal>defined('a=&gt;NULL', 'a')</literal>
<returnvalue>f</returnvalue> <returnvalue>f</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -662,7 +662,7 @@ b
Deletes pair with matching key. Deletes pair with matching key.
</para> </para>
<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> <returnvalue>"a"=&gt;"1"</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -676,7 +676,7 @@ b
Deletes pairs with matching keys. Deletes pairs with matching keys.
</para> </para>
<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> <returnvalue>"c"=&gt;"3"</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -690,7 +690,7 @@ b
Deletes pairs matching those in the second argument. Deletes pairs matching those in the second argument.
</para> </para>
<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> <returnvalue>"a"=&gt;"1"</returnvalue>
</para></entry> </para></entry>
</row> </row>

View File

@ -570,7 +570,7 @@ amgettuple (IndexScanDesc scan,
will pass the caller's snapshot test. On success, <function>amgettuple</function> will pass the caller's snapshot test. On success, <function>amgettuple</function>
must also set <literal>scan-&gt;xs_recheck</literal> to true or false. must also set <literal>scan-&gt;xs_recheck</literal> to true or false.
False means it is certain that the index entry matches the scan keys. False means it is certain that the index entry matches the scan keys.
true means this is not certain, and the conditions represented by the True means this is not certain, and the conditions represented by the
scan keys must be rechecked against the heap tuple after fetching it. scan keys must be rechecked against the heap tuple after fetching it.
This provision supports <quote>lossy</quote> index operators. This provision supports <quote>lossy</quote> index operators.
Note that rechecking will extend only to the scan conditions; a partial Note that rechecking will extend only to the scan conditions; a partial

View File

@ -14,7 +14,7 @@
hard-coded list of prefixes; this list of prefixes is also used to hyphenate hard-coded list of prefixes; this list of prefixes is also used to hyphenate
numbers on output. Since new prefixes are assigned from time to time, the numbers on output. Since new prefixes are assigned from time to time, the
list of prefixes may be out of date. It is hoped that a future version of list of prefixes may be out of date. It is hoped that a future version of
this module will obtained the prefix list from one or more tables that this module will obtain the prefix list from one or more tables that
can be easily updated by users as needed; however, at present, the can be easily updated by users as needed; however, at present, the
list can only be updated by modifying the source code and recompiling. list can only be updated by modifying the source code and recompiling.
Alternatively, prefix validation and hyphenation support may be Alternatively, prefix validation and hyphenation support may be

View File

@ -460,7 +460,7 @@ Europe &amp; Russia*@ &amp; !Transportation
position <parameter>end</parameter>-1 (counting from 0). position <parameter>end</parameter>-1 (counting from 0).
</para> </para>
<para> <para>
<literal>subltree('Top.Child1.Child2',1,2)</literal> <literal>subltree('Top.Child1.Child2', 1, 2)</literal>
<returnvalue>Child1</returnvalue> <returnvalue>Child1</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -480,7 +480,7 @@ Europe &amp; Russia*@ &amp; !Transportation
the end of the path. the end of the path.
</para> </para>
<para> <para>
<literal>subpath('Top.Child1.Child2',0,2)</literal> <literal>subpath('Top.Child1.Child2', 0, 2)</literal>
<returnvalue>Top.Child1</returnvalue> <returnvalue>Top.Child1</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -497,7 +497,7 @@ Europe &amp; Russia*@ &amp; !Transportation
from the end of the path. from the end of the path.
</para> </para>
<para> <para>
<literal>subpath('Top.Child1.Child2',1)</literal> <literal>subpath('Top.Child1.Child2', 1)</literal>
<returnvalue>Child1.Child2</returnvalue> <returnvalue>Child1.Child2</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -528,7 +528,7 @@ Europe &amp; Russia*@ &amp; !Transportation
<parameter>a</parameter>, or -1 if not found. <parameter>a</parameter>, or -1 if not found.
</para> </para>
<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> <returnvalue>6</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -546,7 +546,7 @@ Europe &amp; Russia*@ &amp; !Transportation
start <parameter>-offset</parameter> labels from the end of the path. start <parameter>-offset</parameter> labels from the end of the path.
</para> </para>
<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> <returnvalue>9</returnvalue>
</para></entry> </para></entry>
</row> </row>
@ -584,7 +584,7 @@ Europe &amp; Russia*@ &amp; !Transportation
(up to 8 arguments are supported). (up to 8 arguments are supported).
</para> </para>
<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> <returnvalue>1.2</returnvalue>
</para></entry> </para></entry>
</row> </row>

View File

@ -1246,7 +1246,7 @@ ERROR: could not serialize access due to read/write dependencies among transact
<para> <para>
The <literal>FOR UPDATE</literal> lock mode The <literal>FOR UPDATE</literal> lock mode
is also acquired by any <command>DELETE</command> on a row, and also by an is also acquired by any <command>DELETE</command> on a row, and also by an
<command>UPDATE</command> that modifies the values on certain columns. Currently, <command>UPDATE</command> that modifies the values of certain columns. Currently,
the set of columns considered for the <command>UPDATE</command> case are those that the set of columns considered for the <command>UPDATE</command> case are those that
have a unique index on them that can be used in a foreign key (so partial have a unique index on them that can be used in a foreign key (so partial
indexes and expressional indexes are not considered), but this may change indexes and expressional indexes are not considered), but this may change

View File

@ -471,7 +471,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
</para> </para>
<para> <para>
The following operations are always parallel restricted. The following operations are always parallel restricted:
</para> </para>
<itemizedlist> <itemizedlist>

View File

@ -1143,7 +1143,7 @@ BEGIN
SELECT users.userid INTO STRICT userid SELECT users.userid INTO STRICT userid
FROM users WHERE users.username = get_userid.username; FROM users WHERE users.username = get_userid.username;
RETURN userid; RETURN userid;
END END;
$$ LANGUAGE plpgsql; $$ LANGUAGE plpgsql;
</programlisting> </programlisting>
On failure, this function might produce an error message such as On failure, this function might produce an error message such as
@ -1816,7 +1816,7 @@ BEGIN
RETURN NEXT r; -- return current row of SELECT RETURN NEXT r; -- return current row of SELECT
END LOOP; END LOOP;
RETURN; RETURN;
END END;
$BODY$ $BODY$
LANGUAGE plpgsql; LANGUAGE plpgsql;
@ -1844,7 +1844,7 @@ BEGIN
END IF; END IF;
RETURN; RETURN;
END END;
$BODY$ $BODY$
LANGUAGE plpgsql; LANGUAGE plpgsql;
@ -1918,7 +1918,7 @@ DECLARE myvar int := 5;
BEGIN BEGIN
CALL triple(myvar); CALL triple(myvar);
RAISE NOTICE 'myvar = %', myvar; -- prints 15 RAISE NOTICE 'myvar = %', myvar; -- prints 15
END END;
$$; $$;
</programlisting> </programlisting>
</para> </para>
@ -3521,7 +3521,7 @@ BEGIN
ROLLBACK; ROLLBACK;
END IF; END IF;
END LOOP; END LOOP;
END END;
$$; $$;
CALL transaction_test1(); CALL transaction_test1();
@ -5175,7 +5175,7 @@ DECLARE
f1 int; f1 int;
BEGIN BEGIN
RETURN f1; RETURN f1;
END END;
$$ LANGUAGE plpgsql; $$ LANGUAGE plpgsql;
WARNING: variable "f1" shadows a previously defined variable WARNING: variable "f1" shadows a previously defined variable
LINE 3: f1 int; LINE 3: f1 int;

View File

@ -2839,7 +2839,7 @@ The commands accepted in replication mode are:
<para> <para>
Every sent transaction contains zero or more DML messages (Insert, Every sent transaction contains zero or more DML messages (Insert,
Update, Delete). In case of a cascaded setup it can also contain Origin Update, Delete). In case of a cascaded setup it can also contain Origin
messages. The origin message indicated that the transaction originated on messages. The origin message indicates that the transaction originated on
different replication node. Since a replication node in the scope of logical different replication node. Since a replication node in the scope of logical
replication protocol can be pretty much anything, the only identifier replication protocol can be pretty much anything, the only identifier
is the origin name. It's downstream's responsibility to handle this as is the origin name. It's downstream's responsibility to handle this as

View File

@ -38,7 +38,7 @@ SELECT [ ALL | DISTINCT [ ON ( <replaceable class="parameter">expression</replac
[ FROM <replaceable class="parameter">from_item</replaceable> [, ...] ] [ FROM <replaceable class="parameter">from_item</replaceable> [, ...] ]
[ WHERE <replaceable class="parameter">condition</replaceable> ] [ WHERE <replaceable class="parameter">condition</replaceable> ]
[ GROUP BY <replaceable class="parameter">grouping_element</replaceable> [, ...] ] [ GROUP BY <replaceable class="parameter">grouping_element</replaceable> [, ...] ]
[ HAVING <replaceable class="parameter">condition</replaceable> [, ...] ] [ HAVING <replaceable class="parameter">condition</replaceable> ]
[ WINDOW <replaceable class="parameter">window_name</replaceable> AS ( <replaceable class="parameter">window_definition</replaceable> ) [, ...] ] [ WINDOW <replaceable class="parameter">window_name</replaceable> AS ( <replaceable class="parameter">window_definition</replaceable> ) [, ...] ]
[ { UNION | INTERSECT | EXCEPT } [ ALL | DISTINCT ] <replaceable class="parameter">select</replaceable> ] [ { UNION | INTERSECT | EXCEPT } [ ALL | DISTINCT ] <replaceable class="parameter">select</replaceable> ]
[ ORDER BY <replaceable class="parameter">expression</replaceable> [ ASC | DESC | USING <replaceable class="parameter">operator</replaceable> ] [ NULLS { FIRST | LAST } ] [, ...] ] [ ORDER BY <replaceable class="parameter">expression</replaceable> [ ASC | DESC | USING <replaceable class="parameter">operator</replaceable> ] [ NULLS { FIRST | LAST } ] [, ...] ]

View File

@ -28,7 +28,7 @@ SELECT [ ALL | DISTINCT [ ON ( <replaceable class="parameter">expression</replac
[ FROM <replaceable class="parameter">from_item</replaceable> [, ...] ] [ FROM <replaceable class="parameter">from_item</replaceable> [, ...] ]
[ WHERE <replaceable class="parameter">condition</replaceable> ] [ WHERE <replaceable class="parameter">condition</replaceable> ]
[ GROUP BY <replaceable class="parameter">expression</replaceable> [, ...] ] [ GROUP BY <replaceable class="parameter">expression</replaceable> [, ...] ]
[ HAVING <replaceable class="parameter">condition</replaceable> [, ...] ] [ HAVING <replaceable class="parameter">condition</replaceable> ]
[ WINDOW <replaceable class="parameter">window_name</replaceable> AS ( <replaceable class="parameter">window_definition</replaceable> ) [, ...] ] [ WINDOW <replaceable class="parameter">window_name</replaceable> AS ( <replaceable class="parameter">window_definition</replaceable> ) [, ...] ]
[ { UNION | INTERSECT | EXCEPT } [ ALL | DISTINCT ] <replaceable class="parameter">select</replaceable> ] [ { UNION | INTERSECT | EXCEPT } [ ALL | DISTINCT ] <replaceable class="parameter">select</replaceable> ]
[ ORDER BY <replaceable class="parameter">expression</replaceable> [ ASC | DESC | USING <replaceable class="parameter">operator</replaceable> ] [ NULLS { FIRST | LAST } ] [, ...] ] [ ORDER BY <replaceable class="parameter">expression</replaceable> [ ASC | DESC | USING <replaceable class="parameter">operator</replaceable> ] [ NULLS { FIRST | LAST } ] [, ...] ]

View File

@ -769,7 +769,7 @@ SELECT t1.a, t2.b, t1.ctid FROM t1, t2 WHERE t1.a = t2.a;
</para> </para>
<para> <para>
The benefit of implementing views with the rule system is, The benefit of implementing views with the rule system is
that the planner has all that the planner has all
the information about which tables have to be scanned plus the the information about which tables have to be scanned plus the
relationships between these tables plus the restrictive relationships between these tables plus the restrictive
@ -781,7 +781,7 @@ SELECT t1.a, t2.b, t1.ctid FROM t1, t2 WHERE t1.a = t2.a;
the best path to execute the query, and the more information the best path to execute the query, and the more information
the planner has, the better this decision can be. And the planner has, the better this decision can be. And
the rule system as implemented in <productname>PostgreSQL</productname> the rule system as implemented in <productname>PostgreSQL</productname>
ensures, that this is all information available about the query ensures that this is all information available about the query
up to that point. up to that point.
</para> </para>
</sect2> </sect2>
@ -2087,7 +2087,7 @@ CREATE FUNCTION tricky(text, text) RETURNS bool AS $$
BEGIN BEGIN
RAISE NOTICE '% =&gt; %', $1, $2; RAISE NOTICE '% =&gt; %', $1, $2;
RETURN true; RETURN true;
END END;
$$ LANGUAGE plpgsql COST 0.0000000000000000000001; $$ LANGUAGE plpgsql COST 0.0000000000000000000001;
SELECT * FROM phone_number WHERE tricky(person, phone); SELECT * FROM phone_number WHERE tricky(person, phone);

View File

@ -205,8 +205,8 @@ test=&gt; select '6.25 .. 6.50'::seg as "pH";
</table> </table>
<para> <para>
Because <literal>...</literal> is widely used in data sources, it is allowed Because the <literal>...</literal> operator is widely used in data sources, it is allowed
as an alternative spelling of <literal>..</literal>. Unfortunately, this as an alternative spelling of the <literal>..</literal> operator. Unfortunately, this
creates a parsing ambiguity: it is not clear whether the upper bound creates a parsing ambiguity: it is not clear whether the upper bound
in <literal>0...23</literal> is meant to be <literal>23</literal> or <literal>0.23</literal>. in <literal>0...23</literal> is meant to be <literal>23</literal> or <literal>0.23</literal>.
This is resolved by requiring at least one digit before the decimal This is resolved by requiring at least one digit before the decimal

View File

@ -2419,7 +2419,7 @@ ALTER TEXT SEARCH CONFIGURATION astro_en
positions in <type>tsvector</type>, which in turn affect ranking: positions in <type>tsvector</type>, which in turn affect ranking:
<screen> <screen>
SELECT to_tsvector('english','in the list of stop words'); SELECT to_tsvector('english', 'in the list of stop words');
to_tsvector to_tsvector
---------------------------- ----------------------------
'list':3 'stop':5 'word':6 '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: calculated for documents with and without stop words are quite different:
<screen> <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 ts_rank_cd
------------ ------------
0.05 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 ts_rank_cd
------------ ------------
0.1 0.1
@ -2493,12 +2493,12 @@ CREATE TEXT SEARCH DICTIONARY public.simple_dict (
Now we can test our dictionary: Now we can test our dictionary:
<screen> <screen>
SELECT ts_lexize('public.simple_dict','YeS'); SELECT ts_lexize('public.simple_dict', 'YeS');
ts_lexize ts_lexize
----------- -----------
{yes} {yes}
SELECT ts_lexize('public.simple_dict','The'); SELECT ts_lexize('public.simple_dict', 'The');
ts_lexize ts_lexize
----------- -----------
{} {}
@ -2514,12 +2514,12 @@ SELECT ts_lexize('public.simple_dict','The');
<screen> <screen>
ALTER TEXT SEARCH DICTIONARY public.simple_dict ( Accept = false ); 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 ts_lexize
----------- -----------
SELECT ts_lexize('public.simple_dict','The'); SELECT ts_lexize('public.simple_dict', 'The');
ts_lexize ts_lexize
----------- -----------
{} {}
@ -2633,7 +2633,7 @@ indices index*
Then we will get these results: Then we will get these results:
<screen> <screen>
mydb=# CREATE TEXT SEARCH DICTIONARY syn (template=synonym, synonyms='synonym_sample'); 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 ts_lexize
----------- -----------
{index} {index}
@ -2641,13 +2641,13 @@ mydb=# SELECT ts_lexize('syn','indices');
mydb=# CREATE TEXT SEARCH CONFIGURATION tst (copy=simple); mydb=# CREATE TEXT SEARCH CONFIGURATION tst (copy=simple);
mydb=# ALTER TEXT SEARCH CONFIGURATION tst ALTER MAPPING FOR asciiword WITH syn; 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 to_tsvector
------------- -------------
'index':1 'index':1
(1 row) (1 row)
mydb=# SELECT to_tsquery('tst','indices'); mydb=# SELECT to_tsquery('tst', 'indices');
to_tsquery to_tsquery
------------ ------------
'index':* 'index':*
@ -2659,7 +2659,7 @@ mydb=# SELECT 'indexes are very useful'::tsvector;
'are' 'indexes' 'useful' 'very' 'are' 'indexes' 'useful' 'very'
(1 row) (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? ?column?
---------- ----------
t t
@ -3354,7 +3354,7 @@ ts_debug(<optional> <replaceable class="parameter">config</replaceable> <type>re
Here is a simple example: Here is a simple example:
<screen> <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 alias | description | token | dictionaries | dictionary | lexemes
-----------+-----------------+-------+----------------+--------------+--------- -----------+-----------------+-------+----------------+--------------+---------
asciiword | Word, all ASCII | a | {english_stem} | english_stem | {} asciiword | Word, all ASCII | a | {english_stem} | english_stem | {}
@ -3405,7 +3405,7 @@ ALTER TEXT SEARCH CONFIGURATION public.english
</programlisting> </programlisting>
<screen> <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 alias | description | token | dictionaries | dictionary | lexemes
-----------+-----------------+-------------+-------------------------------+----------------+------------- -----------+-----------------+-------------+-------------------------------+----------------+-------------
asciiword | Word, all ASCII | The | {english_ispell,english_stem} | english_ispell | {} 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> <screen>
SELECT alias, token, dictionary, lexemes 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 alias | token | dictionary | lexemes
-----------+-------------+----------------+------------- -----------+-------------+----------------+-------------
asciiword | The | english_ispell | {} asciiword | The | english_ispell | {}
@ -3592,7 +3592,7 @@ SELECT ts_lexize('english_stem', 'a');
where this can be confusing: where this can be confusing:
<screen> <screen>
SELECT ts_lexize('thesaurus_astro','supernovae stars') is null; SELECT ts_lexize('thesaurus_astro', 'supernovae stars') is null;
?column? ?column?
---------- ----------
t t