From: Justin Pryzby Date: Thu, 28 Mar 2019 18:50:03 -0500 Subject: [PATCH v3 01/12] review docs for pg12dev --- doc/src/sgml/bloom.sgml | 2 +- doc/src/sgml/catalogs.sgml | 4 ++-- doc/src/sgml/config.sgml | 15 +++++++------ doc/src/sgml/ddl.sgml | 8 +++---- doc/src/sgml/ecpg.sgml | 16 ++++++-------- doc/src/sgml/libpq.sgml | 2 +- doc/src/sgml/monitoring.sgml | 44 +++++++++++++++++++------------------- doc/src/sgml/perform.sgml | 8 +++---- doc/src/sgml/protocol.sgml | 6 +++--- doc/src/sgml/ref/alter_table.sgml | 4 ++-- doc/src/sgml/ref/create_index.sgml | 4 ++-- doc/src/sgml/ref/pg_rewind.sgml | 17 +++++++-------- doc/src/sgml/ref/pgbench.sgml | 6 ++---- doc/src/sgml/ref/reindex.sgml | 2 +- doc/src/sgml/runtime.sgml | 7 +++--- doc/src/sgml/sources.sgml | 36 +++++++++++++++---------------- doc/src/sgml/xfunc.sgml | 12 +++++------ src/bin/pg_upgrade/check.c | 6 +++--- 18 files changed, 98 insertions(+), 101 deletions(-) diff --git a/doc/src/sgml/bloom.sgml b/doc/src/sgml/bloom.sgml index 6eeadde..c341b65 100644 --- a/doc/src/sgml/bloom.sgml +++ b/doc/src/sgml/bloom.sgml @@ -65,7 +65,7 @@ Number of bits generated for each index column. Each parameter's name refers to the number of the index column that it controls. The default - is 2 bits and maximum is 4095. Parameters for + is 2 bits and the maximum is 4095. Parameters for index columns not actually used are ignored. diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 4c7e938..d544e60 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -3052,7 +3052,7 @@ SCRAM-SHA-256$<iteration count>:&l simplifies ATTACH/DETACH PARTITION operations: the partition dependencies need only be added or removed. Example: a child partitioned index is made partition-dependent - on both the partition table it is on and the parent partitioned + on both the table partition and the parent partitioned index, so that it goes away if either of those is dropped, but not otherwise. The dependency on the parent index is primary, so that if the user tries to drop the child partitioned index, @@ -3115,7 +3115,7 @@ SCRAM-SHA-256$<iteration count>:&l Note that it's quite possible for two objects to be linked by more than one pg_depend entry. For example, a child partitioned index would have both a partition-type dependency on its - associated partition table, and an auto dependency on each column of + associated table partition, and an auto dependency on each column of that table that it indexes. This sort of situation expresses the union of multiple dependency semantics. A dependent object can be dropped without CASCADE if any of its dependencies satisfies diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 36062c3..73eb768 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -112,7 +112,7 @@ For example, 30.1 GB will be converted to 30822 MB not 32319628902 B. If the parameter is of integer type, a final rounding to integer - occurs after any units conversion. + occurs after any unit conversion. @@ -3433,7 +3433,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows current when the base backup was taken. The value latest recovers to the latest timeline found in the archive, which is useful in - a standby server. latest is the default. + a standby server. The default is latest. @@ -3540,7 +3540,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows servers or streaming base backup clients (i.e., the maximum number of simultaneously running WAL sender processes). The default is 10. The value 0 means - replication is disabled. Abrupt streaming client disconnection might + replication is disabled. Abrupt disconnection of a streaming client might leave an orphaned connection slot behind until a timeout is reached, so this parameter should be set slightly higher than the maximum number of expected clients so disconnected clients can immediately @@ -4195,8 +4195,9 @@ ANY num_sync ( bytea - The handling of the bytea type is also similar to - the VARCHAR. The definition on an array of type + The handling of the bytea type is similar to + the VARCHAR. The definition of an array of type bytea is converted into a named struct for every variable. A declaration like: @@ -1220,9 +1220,8 @@ bytea var[180]; struct bytea_var { int len; char arr[180]; } var; - The member arr hosts binary format - data. It also can handle even '\0' as part of - data unlike VARCHAR. + The member arr stores binary format + data, which can include zero bytes, unlike VARCHAR. The data is converted from/to hex format and sent/received by ecpglib. @@ -7571,8 +7570,7 @@ PREPARE name FROM A literal C string or a host variable containing a preparable - statement, one of the SELECT, INSERT, UPDATE, or - DELETE. + statement (SELECT, INSERT, UPDATE, or DELETE). diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 7f01fcc..8a8427f 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1122,7 +1122,7 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname connect_timeout - Maximum wait for connection, in seconds (write as a decimal integer, + Maximum time to wait while connecting, in seconds (write as a decimal integer, e.g. 10). Zero, negative, or not specified means wait indefinitely. The minimum allowed timeout is 2 seconds, therefore a value of 1 is interpreted as 2. diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index a179d61..6c98596 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -271,13 +271,13 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser Some of the information in the dynamic statistics views shown in is security restricted. - Ordinary users can only see all the information about their own sessions - (sessions belonging to a role that they are a member of). In rows about + Ordinary users can only see all information about their own sessions + (sessions belonging to a role of which they are a member). In rows for other sessions, many columns will be null. Note, however, that the existence of a session and its general properties such as its sessions user and database are visible to all users. Superusers and members of the built-in role pg_read_all_stats (see also ) can see all the information about all sessions. + linkend="default-roles"/>) can see all information about all sessions. @@ -2504,14 +2504,14 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i datname name - Name of this database, or NULL for the shared + Name of this database, or NULL for shared objects. numbackends integer Number of backends currently connected to this database, or - NULL for the shared objects. This is the only column + NULL for shared objects. This is the only column in this view that returns a value reflecting current state; all other columns return the accumulated values since the last reset. @@ -2633,7 +2633,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i The pg_stat_database view will contain one row - for each database in the cluster, plus one for the shared objects, showing + for each database in the cluster, plus one for shared objects, showing database-wide statistics. @@ -3594,16 +3594,16 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid, partitions_totalbigint - When creating an index on a partitioned table, this column is set to - the total number of partitions on which the index is to be created. + When creating an index on a partitioned table, this is + the total number of partitions to be processed. partitions_done bigint - When creating an index on a partitioned table, this column is set to - the number of partitions on which the index has been completed. + When creating an index on a partitioned table, this is + the number of partitions for which the process is complete. @@ -3643,9 +3643,9 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid, The index is being built by the access method-specific code. In this phase, access methods that support progress reporting fill in their own progress data, - and the subphase is indicated in this column. Typically, + and the subphase is indicated in this column. blocks_total and blocks_done - will contain progress data, as well as potentially + will contain progress data, as may tuples_total and tuples_done. @@ -3730,15 +3730,15 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid, VACUUM Progress Reporting - Whenever VACUUM is running, the - pg_stat_progress_vacuum view will contain - one row for each backend (including autovacuum worker processes) that is - currently vacuuming. The tables below describe the information + The pg_stat_progress_vacuum view will contain one + row for each backend that is running VACUUM, including + autovacuum worker processes. + The tables below describe the information that will be reported and provide information about how to interpret it. Progress for VACUUM FULL commands is reported via - pg_stat_progress_cluster - because both VACUUM FULL and CLUSTER - rewrite the table, while regular VACUUM only modifies it + pg_stat_progress_cluster, + because VACUUM FULL rewrites the table, like CLUSTER, + while regular VACUUM only modifies it in place. See . @@ -3922,9 +3922,9 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid, CLUSTER Progress Reporting - Whenever CLUSTER or VACUUM FULL is - running, the pg_stat_progress_cluster view will - contain a row for each backend that is currently running either command. + The pg_stat_progress_cluster view will contain a + row for each backend that is running either + CLUSTER or VACUUM FULL. The tables below describe the information that will be reported and provide information about how to interpret it. diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml index a84be85..65c161b 100644 --- a/doc/src/sgml/perform.sgml +++ b/doc/src/sgml/perform.sgml @@ -899,10 +899,10 @@ EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE unique1 < 100 AND unique2 > 9000 Generally, the EXPLAIN output will display details for every plan node which was generated by the query planner. However, there are cases where the executor is able to determine that certain nodes are - not required; currently, the only node types to support this are the - Append and MergeAppend nodes. These - node types have the ability to discard subnodes which they are able to - determine won't contain any records required by the query. It is possible + not required; currently, the only node types to support this are + Append and MergeAppend, which + are able to discard subnodes when it's deduced that + they will not contain any records required by the query. It is possible to determine that nodes have been removed in this way by the presence of a "Subplans Removed" property in the EXPLAIN output. diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index b20f169..70f7286 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -1515,7 +1515,7 @@ SELECT 1/0; the server will only accept encrypted packets from the client which are less than 16kB; gss_wrap_size_limit() should be used by the client to determine the size of the unencrypted message which will fit - within this limit and larger messages should be broken up into multiple + within this limit; larger messages should be broken up into multiple gss_wrap() calls. Typical segments are 8kB of unencrypted data, resulting in encrypted packets of slightly larger than 8kB but well within the 16kB maximum. The server can be expected to not send @@ -1531,8 +1531,8 @@ SELECT 1/0; support to PostgreSQL. In this case the connection must be closed, but the frontend might choose to open a fresh connection and proceed without requesting GSSAPI - encryption. Given the length limits specified above, the ErrorMessage can - not be confused with a proper response from the server with an appropriate + encryption. Given the length limits specified above, the ErrorMessage + cannot be confused with a proper response from the server with an appropriate length. diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 49b081a..dd80bd0 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -219,7 +219,7 @@ WITH ( MODULUS numeric_literal, REM SET NOT NULL may only be applied to a column - providing none of the records in the table contain a + provided none of the records in the table contain a NULL value for the column. Ordinarily this is checked during the ALTER TABLE by scanning the entire table; however, if a valid CHECK constraint is @@ -642,7 +642,7 @@ WITH ( MODULUS numeric_literal, REM When applied to a partitioned table, nothing is moved, but any partitions created afterwards with CREATE TABLE PARTITION OF will use that tablespace, - unless the TABLESPACE clause is used to override it. + unless overridden by its TABLESPACE clause. diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml index 30bb38b..bf4f550 100644 --- a/doc/src/sgml/ref/create_index.sgml +++ b/doc/src/sgml/ref/create_index.sgml @@ -181,8 +181,8 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] - Currently, the B-tree and the GiST index access methods support this - feature. In B-tree and the GiST indexes, the values of columns listed + Currently, only the B-tree and GiST index access methods support this + feature. In B-tree and GiST indexes, the values of columns listed in the INCLUDE clause are included in leaf tuples which correspond to heap tuples, but are not included in upper-level index entries used for tree navigation. diff --git a/doc/src/sgml/ref/pg_rewind.sgml b/doc/src/sgml/ref/pg_rewind.sgml index 4d91eeb..6f6d220 100644 --- a/doc/src/sgml/ref/pg_rewind.sgml +++ b/doc/src/sgml/ref/pg_rewind.sgml @@ -106,15 +106,14 @@ PostgreSQL documentation - pg_rewind will fail immediately if it finds - files it cannot write directly to. This can happen for example when - the source and the target server use the same file mapping for read-only - SSL keys and certificates. If such files are present on the target server + pg_rewind will fail immediately if it experiences + a write error. This can happen for example when + the source and target server use the same file mapping for read-only + SSL keys and certificates. If such files are present on the target server, it is recommended to remove them before running - pg_rewind. After doing the rewind, some of + pg_rewind. After performing the rewind, some of those files may have been copied from the source, in which case it may - be necessary to remove the data copied and restore back the set of links - used before the rewind. + be necessary to remove them and restore the files removed beforehand. @@ -185,7 +184,7 @@ PostgreSQL documentation pg_rewind to return without waiting, which is faster, but means that a subsequent operating system crash can leave the synchronized data folder corrupt. Generally, this option is - useful for testing but should not be used when creating a production + useful for testing but should not be used on a production installation. @@ -266,7 +265,7 @@ GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, b When executing pg_rewind using an online cluster as source which has been recently promoted, it is necessary - to execute a CHECKPOINT after promotion so as its + to execute a CHECKPOINT after promotion such that its control file reflects up-to-date timeline information, which is used by pg_rewind to check if the target cluster can be rewound using the designated source cluster. diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml index ef22a48..7e8fc19 100644 --- a/doc/src/sgml/ref/pgbench.sgml +++ b/doc/src/sgml/ref/pgbench.sgml @@ -474,10 +474,8 @@ pgbench options d - Because in "prepared" mode pgbench reuses - the parse analysis result for the second and subsequent query - iteration, pgbench runs faster in the - prepared mode than in other modes. + pgbench runs faster in prepared mode because the + parse analysis happens only during the first query. The default is simple query protocol. (See diff --git a/doc/src/sgml/ref/reindex.sgml b/doc/src/sgml/ref/reindex.sgml index 303436c..5a1f634 100644 --- a/doc/src/sgml/ref/reindex.sgml +++ b/doc/src/sgml/ref/reindex.sgml @@ -240,7 +240,7 @@ REINDEX [ ( VERBOSE ) ] { INDEX | TABLE | SCHEMA | DATABASE | SYSTEM } [ CONCURR Reindexing a single index or table requires being the owner of that index or table. Reindexing a schema or database requires being the - owner of that schema or database. Note that is therefore sometimes + owner of that schema or database. Note specifically that it's possible for non-superusers to rebuild indexes of tables owned by other users. However, as a special exception, when REINDEX DATABASE, REINDEX SCHEMA diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index e053e2e..798da30 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -2634,8 +2634,9 @@ openssl x509 -req -in server.csr -text -days 365 \ using GSSAPI to encrypt client/server communications for increased security. Support requires that a GSSAPI implementation (such as MIT krb5) is installed on both client and server - systems, and that support in PostgreSQL is - enabled at build time (see ). + systems, and must be enabled at the time + PostgreSQL is built (see ). @@ -2644,7 +2645,7 @@ openssl x509 -req -in server.csr -text -days 365 \ The PostgreSQL server will listen for both normal and GSSAPI-encrypted connections on the same TCP - port, and will negotiate with any connecting client on whether to + port, and will negotiate with any connecting client whether to use GSSAPI for encryption (and for authentication). By default, this decision is up to the client (which means it can be downgraded by an attacker); see about diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml index a339ebb..2b9f59d 100644 --- a/doc/src/sgml/sources.sgml +++ b/doc/src/sgml/sources.sgml @@ -103,7 +103,7 @@ less -x4 message text. In addition there are optional elements, the most common of which is an error identifier code that follows the SQL spec's SQLSTATE conventions. - ereport itself is just a shell function, that exists + ereport itself is just a shell function that exists mainly for the syntactic convenience of making message generation look like a function call in the C source code. The only parameter accepted directly by ereport is the severity level. @@ -359,7 +359,7 @@ ereport(ERROR, specify suppression of the CONTEXT: portion of a message in the postmaster log. This should only be used for verbose debugging messages where the repeated inclusion of context would bloat the log - volume too much. + too much. @@ -452,8 +452,8 @@ Hint: the addendum enough for error messages. Detail and hint messages can be relegated to a verbose mode, or perhaps a pop-up error-details window. Also, details and hints would normally be suppressed from the server log to save - space. Reference to implementation details is best avoided since users - aren't expected to know the details. + space. References to implementation details are best avoided since users + aren't expected to know them. @@ -504,14 +504,14 @@ Hint: the addendum Use of Quotes - Use quotes always to delimit file names, user-supplied identifiers, and + Always use quotes to delimit file names, user-supplied identifiers, and other variables that might contain words. Do not use them to mark up variables that will not contain words (for example, operator names). There are functions in the backend that will double-quote their own output - at need (for example, format_type_be()). Do not put + as needed (for example, format_type_be()). Do not put additional quotes around the output of such functions. @@ -880,16 +880,16 @@ BETTER: unrecognized node type: 42 practices. - Features from later revision of the C standard or compiler specific + Features from later revisions of the C standard or compiler specific features can be used, if a fallback is provided. - For example _StaticAssert() and + For example, _StaticAssert() and __builtin_constant_p are currently used, even though - they are from newer revisions of the C standard and a - GCC extension respectively. If not available - we respectively fall back to using a C99 compatible replacement that - performs the same checks, but emits rather cryptic messages and do not + they are from a newer revision of the C standard and a + GCC extension, respectively. If not available, in the first case, + we fall back to using a C99 compatible replacement that + performs the same checks, but emits rather cryptic messages; in the second case, we do not use __builtin_constant_p. @@ -939,8 +939,8 @@ MemoryContextSwitchTo(MemoryContext context) To be suitable to run inside a signal handler code has to be written very carefully. The fundamental problem is that, unless blocked, a signal handler can interrupt code at any time. If code - inside the signal handler uses the same state as code outside - chaos may ensue. As an example consider what happens if a signal + inside the signal handler uses the same state as code outside, + chaos may ensue. As an example, consider what happens if a signal handler tries to acquire a lock that's already held in the interrupted code. @@ -948,7 +948,7 @@ MemoryContextSwitchTo(MemoryContext context) Barring special arrangements code in signal handlers may only call async-signal safe functions (as defined in POSIX) and access variables of type volatile sig_atomic_t. A few - functions in postgres are also deemed signal safe, importantly + functions in postgres are also deemed signal safe; specifically, SetLatch(). @@ -969,9 +969,9 @@ handle_sighup(SIGNAL_ARGS) } errno is saved and restored because - SetLatch() might change it. If that were not done - interrupted code that's currently inspecting errno might see the wrong - value. + SetLatch() might change it. If that were not done, + code interrupted by a signal might see the wrong value of + errno. diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml index 3403269..5c17b10 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -3364,11 +3364,11 @@ if (!ptr) - By default, a function is just a black box that the - database system knows very little about the behavior of. However, - that means that queries using the function may be executed much less + By default, a function is a black box that the + database system knows very little about, which + means queries calling the function may be executed less efficiently than they could be. It is possible to supply additional - knowledge that helps the planner optimize function calls. + information that helps the planner optimize function calls. @@ -3381,7 +3381,7 @@ if (!ptr) The parallel safety property (PARALLEL UNSAFE, PARALLEL RESTRICTED, or PARALLEL SAFE) must also be specified if you hope - to use the function in parallelized queries. + queries calling the function to use parallel query. It can also be useful to specify the function's estimated execution cost, and/or the number of rows a set-returning function is estimated to return. However, the declarative way of specifying those two @@ -3393,7 +3393,7 @@ if (!ptr) It is also possible to attach a planner support function to a SQL-callable function (called its target function), and thereby provide - knowledge about the target function that is too complex to be + information about the target function that is too complex to be represented declaratively. Planner support functions have to be written in C (although their target functions might not be), so this is an advanced feature that relatively few people will use. diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c index 617270f..370c7aa 100644 --- a/src/bin/pg_upgrade/check.c +++ b/src/bin/pg_upgrade/check.c @@ -222,13 +222,13 @@ output_completion_banner(char *analyze_script_file_name, /* Did we copy the free space files? */ if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804) pg_log(PG_REPORT, - "Optimizer statistics are not transferred by pg_upgrade so,\n" - "once you start the new server, consider running:\n" + "Optimizer statistics are not transferred by pg_upgrade.\n" + "Once you start the new server, consider running:\n" " %s\n\n", analyze_script_file_name); else pg_log(PG_REPORT, "Optimizer statistics and free space information are not transferred\n" - "by pg_upgrade so, once you start the new server, consider running:\n" + "by pg_upgrade. Once you start the new server, consider running:\n" " %s\n\n", analyze_script_file_name); -- 2.7.4 --cWoXeonUoKmBZSoM Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v3-0002-Add-comma-for-readability.patch"