From 5e86d226e46cf4e0efe281cfda3c1e8d8171dffd Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 19 Nov 2001 09:05:02 +0000 Subject: [PATCH] Grammatical and spelling fixes. --- doc/src/sgml/array.sgml | 4 +- doc/src/sgml/datatype.sgml | 69 +++++++++++++++--------------- doc/src/sgml/func.sgml | 14 +++--- doc/src/sgml/indices.sgml | 36 ++++++++-------- doc/src/sgml/syntax.sgml | 6 +-- src/backend/utils/adt/datetime.c | 6 +-- src/backend/utils/adt/formatting.c | 4 +- src/backend/utils/adt/varlena.c | 6 +-- 8 files changed, 73 insertions(+), 72 deletions(-) diff --git a/doc/src/sgml/array.sgml b/doc/src/sgml/array.sgml index 4bda19f3e2..362b118aaa 100644 --- a/doc/src/sgml/array.sgml +++ b/doc/src/sgml/array.sgml @@ -1,4 +1,4 @@ - + Arrays @@ -20,7 +20,7 @@ CREATE TABLE sal_emp ( ); As shown, an array data type is named by appending square brackets - ([ ]) to the data type name of the array elements. + ([]) to the data type name of the array elements. The above query will create a table named sal_emp with a text string (name), a one-dimensional array of type diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index a8f5d7e20f..3c9c3ce527 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1,5 +1,5 @@ @@ -23,15 +23,12 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.70 2001/11/19 03:58:22 tg shows all general-purpose data types - available to users. Most of the alternative names listed in the + included in the standard distribution. Most of the alternative names + listed in the Aliases column are the names used internally by Postgres for historical reasons. In addition, some internally used or deprecated types are available, - but they are not documented here. Many of the built-in types have - obvious external formats. However, several types are either unique - to Postgres, such as open and closed - paths, or have several possibilities for formats, such as the date - and time types. + but they are not listed here. @@ -242,7 +239,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.70 2001/11/19 03:58:22 tg timestamp [ with time zone ] timestamptz - date and time + date and time, including time zone @@ -264,9 +261,21 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.70 2001/11/19 03:58:22 tg + Each data type has an external representation determined by its input + and output functions. Many of the built-in types have + obvious external formats. However, several types are either unique + to Postgres, such as open and closed + paths, or have several possibilities for formats, such as the date + and time types. Most of the input and output functions corresponding to the base types (e.g., integers and floating point numbers) do some error-checking. + Some of the input and output functions are not invertible. That is, + the result of an output function may lose precision when compared to + the original input. + + + Some of the operators and functions (e.g., addition and multiplication) do not perform run-time error-checking in the interests of improving execution speed. @@ -274,12 +283,6 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.70 2001/11/19 03:58:22 tg silently underflow or overflow. - - Some of the input and output functions are not invertible. That is, - the result of an output function may lose precision when compared to - the original input. - - Numeric Types @@ -465,6 +468,14 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.70 2001/11/19 03:58:22 tg platform where this is actually the case. + + SQL only specifies the integer types integer (or + int) and smallint. The type + bigint, and the type names int2, + int4, and int8 are extensions, which + are shared with various other RDBMS products. + + If you have a column of type smallint or @@ -475,25 +486,17 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.70 2001/11/19 03:58:22 tg ... WHERE smallint_column = 42 will not use an index, because the system assigns type - integer to the 42, and PostgreSQL currently cannot - use an index when two different data types are involved. A + integer to the constant 42, and PostgreSQL currently + cannot use an index when two different data types are involved. A workaround is to single-quote the constant, thus: ... WHERE smallint_column = '42' - This will cause the system to delay the type resolution and will + This will cause the system to delay type resolution and will assign the right type to the constant. - - SQL only specifies the integer types integer (or - int) and smallint. The type - bigint, and the type names int2, - int4, and int8 are extensions, which - are shared with various other RDBMS products. - - @@ -609,9 +612,9 @@ NUMERIC Normally, the real type has a range of at least - -1E+37 to +1E+37 with a precision of at least 6. The + -1E+37 to +1E+37 with a precision of at least 6 decimal digits. The double precision type normally has a range of around - -1E+308 to +1E+308 with a precision of at least 15. Values that + -1E+308 to +1E+308 with a precision of at least 15 digits. Values that are too large or too small will cause an error. Rounding may take place if the precision of an input number is too high. Numbers too close to zero that are not representable as distinct @@ -1553,13 +1556,13 @@ January 8 04:05:06 1999 PST or abbreviations or plurals of these units; Direction can be ago or empty. The at sign (@) is optional noise. The amounts - of different quantities are implicitly added up with appropriate + of different units are implicitly added up with appropriate sign accounting. Quantities of days, hours, minutes, and seconds can be specified without - explicit unit markings: for example, '1 12:59:10' is read + explicit unit markings. For example, '1 12:59:10' is read the same as '1 day 12 hours 59 min 10 sec'. @@ -1637,10 +1640,6 @@ January 8 04:05:06 1999 PST - 'now' is resolved when the value is inserted, 'current' - is resolved every time the value is retrieved. So you probably want to use 'now' - in most applications. (Of course you really want to use - CURRENT_TIMESTAMP, which is equivalent to 'now'.) @@ -1705,7 +1704,7 @@ January 8 04:05:06 1999 PST - The output of the date and time styles is of course + The output of the date and time types is of course only the date or time part in accordance with the above examples. @@ -1794,7 +1793,7 @@ January 8 04:05:06 1999 PST Although the date type does not have an associated time zone, the - time type can or does. + time type can. Time zones in the real world can have no meaning unless associated with a date as well as a time since the offset may vary through the year with daylight savings diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 7407841d6c..e9d9b47aeb 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,5 +1,5 @@ @@ -31,7 +31,7 @@ Postgres documentation and some explicitly marked functions, are not specified by the SQL standard. Some of this extended functionality is present in other RDBMS products, and in many cases this - functionality is compatible and consistant between various products. + functionality is compatible and consistent between various products. @@ -697,8 +697,8 @@ Postgres documentation Functions returning a numeric result take numeric input arguments, unless otherwise specified. Many of these functions are implemented on top - of the host system's C library and behavior in boundary cases could - therefore vary depending on the operating system. + of the host system's C library; accuracy and behavior in boundary cases + could therefore vary depending on the host system. @@ -828,7 +828,7 @@ Postgres documentation char_length(string) or character_length(string)integer - length of string + number of characters in string character strings length @@ -892,7 +892,7 @@ Postgres documentation characters (a space by default) from the beginning/end/both ends of the string. - trim(both 'x' from 'xTomx') + trim(both 'x' from 'xTomxx')Tom @@ -910,7 +910,7 @@ Postgres documentation Additional string manipulation functions are available and are listed below. Some of them are used internally to implement the - SQL string functions listed above. + SQL-standard string functions listed above.
diff --git a/doc/src/sgml/indices.sgml b/doc/src/sgml/indices.sgml index 26ffcfc0c2..3fc74c9374 100644 --- a/doc/src/sgml/indices.sgml +++ b/doc/src/sgml/indices.sgml @@ -1,4 +1,4 @@ - + Indexes @@ -83,10 +83,9 @@ CREATE INDEX test1_id_index ON test1 (id); - Indexes can also benefit UPDATEs and - DELETEs with search conditions. Note that a - query or data manipulation commands can only use at most one index - per table. Indexes can also be used in table join methods. Thus, + Indexes can benefit UPDATEs and + DELETEs with search conditions. Indexes can also be + used in join queries. Thus, an index defined on a column that is part of a join condition can significantly speed up queries with joins. @@ -95,7 +94,9 @@ CREATE INDEX test1_id_index ON test1 (id); When an index is created, it has to be kept synchronized with the table. This adds overhead to data manipulation operations. Therefore indexes that are non-essential or do not get used at all - should be removed. + should be removed. Note that a + query or data manipulation command can use at most one index + per table. @@ -140,7 +141,7 @@ CREATE INDEX test1_id_index ON test1 (id); R-tree indexes - R-tree indexes are especially suited for spacial data. To create + R-tree indexes are especially suited for spatial data. To create an R-tree index, use a command of the form CREATE INDEX name ON table USING RTREE (column); @@ -221,7 +222,7 @@ CREATE TABLE test2 ( name varchar ); - (Say, you keep you your /dev + (Say, you keep your /dev directory in a database...) and you frequently make queries like SELECT name FROM test2 WHERE major = constant AND minor = constant; @@ -337,11 +338,11 @@ CREATE UNIQUE INDEX name ON table For example, a common way to do case-insensitive comparisons is to - use the lower: + use the lower function: SELECT * FROM test1 WHERE lower(col1) = 'value'; - In order for that query to be able to use an index, it has to be + This query can use an index, if one has been defined on the result of the lower(column) operation: @@ -360,8 +361,8 @@ CREATE INDEX test1_lower_col1_idx ON test1 (lower(col1)); The restrictions mentioned in the previous paragraph can easily be - worked around by defining custom functions to use in the index - definition that call the desired function(s) internally. + worked around by defining a custom function to use in the index + definition that computes any desired result internally. @@ -600,7 +601,8 @@ CREATE MEMSTORE ON table COLUMNS colspartial index is an index built over a subset of a table; the subset is defined by a conditional expression (called the predicate of the - partial index). + partial index). The index contains entries for only those table + rows that satisfy the predicate. @@ -608,8 +610,8 @@ CREATE MEMSTORE ON table COLUMNS cols shows a possible application of this idea. @@ -766,7 +768,7 @@ SELECT * FROM orders WHERE order_nr = 3501; Although indexes in PostgreSQL do not need - maintenance and tuning, it is still important that it is checked + maintenance and tuning, it is still important to check which indexes are actually used by the real-life query workload. Examining index usage is done with the EXPLAIN command; its application for this purpose is illustrated in If you do not succeed in adjusting the costs to be more - appropriate, then you may have to do with forcing index usage + appropriate, then you may have to resort to forcing index usage explicitly. You may also want to contact the PostgreSQL developers to examine the issue. diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml index a19a37c6cb..c3e1ae59ea 100644 --- a/doc/src/sgml/syntax.sgml +++ b/doc/src/sgml/syntax.sgml @@ -1,5 +1,5 @@ @@ -743,8 +743,8 @@ CAST ( 'string' AS type ) Transaction identifiers are 32-bit quantities. In a long-lived database it is possible for transaction IDs to wrap around. This is not a fatal problem given appropriate maintenance procedures; - see the Administrator's Guide for details. However, it is unwise - to depend on uniqueness of transaction IDs over the long term + see the Administrator's Guide for details. However, it is + unwise to depend on uniqueness of transaction IDs over the long term (more than one billion transactions). diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index 66562f6d69..a6cb8c5695 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.78 2001/11/06 16:29:51 thomas Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.79 2001/11/19 09:05:01 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -953,7 +953,7 @@ DecodeDateTime(char **field, int *ftype, int nf, if (tm->tm_year > 0) tm->tm_year = -(tm->tm_year - 1); else - elog(ERROR, "Inconsistant use of year %04d and 'BC'", tm->tm_year); + elog(ERROR, "Inconsistent use of year %04d and 'BC'", tm->tm_year); } else if (is2digits) { @@ -1405,7 +1405,7 @@ DecodeDate(char *str, int fmask, int *tmask, struct tm * tm) if (tm->tm_year > 0) tm->tm_year = -(tm->tm_year - 1); else - elog(ERROR, "Inconsistant use of year %04d and 'BC'", tm->tm_year); + elog(ERROR, "Inconsistent use of year %04d and 'BC'", tm->tm_year); } else if (is2digits) { diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index d7c92bb91b..07f868b45f 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- * formatting.c * - * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.44 2001/11/05 17:46:29 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.45 2001/11/19 09:05:01 tgl Exp $ * * * Portions Copyright (c) 1999-2000, PostgreSQL Global Development Group @@ -3050,7 +3050,7 @@ to_timestamp(PG_FUNCTION_ARGS) if (tm.tm_year > 0) tm.tm_year = -(tm.tm_year - 1); else - elog(ERROR, "Inconsistant use of year %04d and 'BC'", tm.tm_year); + elog(ERROR, "Inconsistent use of year %04d and 'BC'", tm.tm_year); } if (tmfc.j) diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index a6600a2254..d2e7b7d518 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.75 2001/11/18 12:07:07 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.76 2001/11/19 09:05:02 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -328,7 +328,7 @@ textcat(PG_FUNCTION_ARGS) * - string length * * If the starting position is zero or less, then return from the start of the string - * adjusting the length to be consistant with the "negative start" per SQL92. + * adjusting the length to be consistent with the "negative start" per SQL92. * If the length is less than zero, return the remaining string. * * Note that the arguments operate on octet length, @@ -740,7 +740,7 @@ byteacat(PG_FUNCTION_ARGS) * - string length * * If the starting position is zero or less, then return from the start of the string - * adjusting the length to be consistant with the "negative start" per SQL92. + * adjusting the length to be consistent with the "negative start" per SQL92. * If the length is less than zero, return the remaining string. * */ -- 2.40.0