From 65976cd86a9bdeec5a5277545e5efa33724102c8 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Mon, 9 Jul 2018 16:10:44 +0300 Subject: [PATCH] Fix misc typos, mostly in comments. A collection of typos I happened to spot while reading code, as well as grepping for common mistakes. Backpatch to all supported versions, as applicable, to avoid conflicts when backporting other commits in the future. --- contrib/bloom/blscan.c | 2 +- doc/src/sgml/protocol.sgml | 2 +- doc/src/sgml/spi.sgml | 2 +- src/backend/access/transam/multixact.c | 4 ++-- src/backend/commands/cluster.c | 2 +- src/backend/commands/explain.c | 2 +- src/backend/executor/nodeModifyTable.c | 2 +- src/backend/optimizer/plan/planner.c | 4 ++-- src/backend/parser/parse_func.c | 2 +- src/backend/replication/logical/origin.c | 2 +- src/backend/utils/time/snapmgr.c | 4 ++-- src/bin/initdb/t/001_initdb.pl | 2 +- src/bin/pg_upgrade/tablespace.c | 2 +- src/include/nodes/execnodes.h | 2 +- src/include/nodes/parsenodes.h | 10 +++++----- src/include/port/pg_bswap.h | 2 +- src/include/storage/latch.h | 2 +- src/include/utils/rel.h | 2 +- src/interfaces/ecpg/ecpglib/execute.c | 4 ++-- src/interfaces/ecpg/preproc/parse.pl | 4 ++-- src/pl/tcl/pltcl.c | 2 +- src/test/regress/expected/rowsecurity.out | 2 +- src/test/regress/expected/rules.out | 2 +- src/test/regress/sql/rowsecurity.sql | 2 +- src/test/regress/sql/rules.sql | 2 +- 25 files changed, 34 insertions(+), 34 deletions(-) diff --git a/contrib/bloom/blscan.c b/contrib/bloom/blscan.c index 0744d74de7..2d81e38218 100644 --- a/contrib/bloom/blscan.c +++ b/contrib/bloom/blscan.c @@ -76,7 +76,7 @@ blendscan(IndexScanDesc scan) } /* - * Insert all matching tuples into to a bitmap. + * Insert all matching tuples into a bitmap. */ int64 blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm) diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index cfc805f785..46d7e19f10 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -6773,7 +6773,7 @@ Delete Identifies the following TupleData message as a old tuple. - This field is is present if the table in which the delete has + This field is present if the table in which the delete has happened has REPLICA IDENTITY set to FULL. diff --git a/doc/src/sgml/spi.sgml b/doc/src/sgml/spi.sgml index 1260275864..2dad215859 100644 --- a/doc/src/sgml/spi.sgml +++ b/doc/src/sgml/spi.sgml @@ -2686,7 +2686,7 @@ SPIPlanPtr SPI_saveplan(SPIPlanPtr plan) SPI_register_relation - make a ephemeral named relation available by name in SPI queries + make an ephemeral named relation available by name in SPI queries diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c index a9a51055e9..365daf153a 100644 --- a/src/backend/access/transam/multixact.c +++ b/src/backend/access/transam/multixact.c @@ -2555,7 +2555,7 @@ SetOffsetVacuumLimit(bool is_startup) /* * NB: Have to prevent concurrent truncation, we might otherwise try to - * lookup a oldestMulti that's concurrently getting truncated away. + * lookup an oldestMulti that's concurrently getting truncated away. */ LWLockAcquire(MultiXactTruncationLock, LW_SHARED); @@ -2732,7 +2732,7 @@ find_multixact_start(MultiXactId multi, MultiXactOffset *result) /* * Flush out dirty data, so PhysicalPageExists can work correctly. * SimpleLruFlush() is a pretty big hammer for that. Alternatively we - * could add a in-memory version of page exists, but find_multixact_start + * could add an in-memory version of page exists, but find_multixact_start * is called infrequently, and it doesn't seem bad to flush buffers to * disk before truncation. */ diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index 482d463420..0112a87224 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -1581,7 +1581,7 @@ finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap, * swap_relation_files()), thus relfrozenxid was not updated. That's * annoying because a potential reason for doing a VACUUM FULL is a * imminent or actual anti-wraparound shutdown. So, now that we can - * access the new relation using it's indices, update relfrozenxid. + * access the new relation using its indices, update relfrozenxid. * pg_class doesn't have a toast relation, so we don't need to update the * corresponding toast relation. Not that there's little point moving all * relfrozenxid updates here since swap_relation_files() needs to write to diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 73d94b7235..16a80a0ea1 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -3341,7 +3341,7 @@ ExplainPropertyListNested(const char *qlabel, List *data, ExplainState *es) * If "numeric" is true, the value is a number (or other value that * doesn't need quoting in JSON). * - * If unit is is non-NULL the text format will display it after the value. + * If unit is non-NULL the text format will display it after the value. * * This usually should not be invoked directly, but via one of the datatype * specific routines ExplainPropertyText, ExplainPropertyInteger, etc. diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index 779b3d4894..f535762e2d 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c @@ -1347,7 +1347,7 @@ lreplace:; * (but still lock row, even though it may not satisfy estate's * snapshot). * - * Returns true if if we're done (with or without an update), or false if + * Returns true if we're done (with or without an update), or false if * the caller must retry the INSERT from scratch. */ static bool diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index e9b4f5970a..e76d1295c8 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -6910,8 +6910,8 @@ apply_scanjoin_target_to_paths(PlannerInfo *root, scanjoin_targets_contain_srfs); /* - * If the relation is partitioned, recurseively apply the same changes to - * all partitions and generate new Append paths. Since Append is not + * If the relation is partitioned, recursively apply the same changes to + * all partitions and generate new Append paths. Since Append is not * projection-capable, that might save a separate Result node, and it also * is important for partitionwise aggregate. */ diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c index c2feaf371f..44257154b8 100644 --- a/src/backend/parser/parse_func.c +++ b/src/backend/parser/parse_func.c @@ -2195,7 +2195,7 @@ LookupFuncWithArgs(ObjectType objtype, ObjectWithArgs *func, bool noError) else if (func->args_unspecified) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_FUNCTION), - errmsg("could not find a aggregate named \"%s\"", + errmsg("could not find an aggregate named \"%s\"", NameListToString(func->objname)))); else if (argcount == 0) ereport(ERROR, diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c index 3d3f6dff1b..595eb252d2 100644 --- a/src/backend/replication/logical/origin.c +++ b/src/backend/replication/logical/origin.c @@ -1448,7 +1448,7 @@ pg_show_replication_origin_status(PG_FUNCTION_ARGS) int i; #define REPLICATION_ORIGIN_PROGRESS_COLS 4 - /* we we want to return 0 rows if slot is set to zero */ + /* we want to return 0 rows if slot is set to zero */ replorigin_check_prerequisites(false, true); if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 4b45d3cccd..edf59efc29 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -1087,8 +1087,8 @@ AtEOXact_Snapshot(bool isCommit, bool resetXmin) * it's too late to abort the transaction, and (2) leaving a leaked * file around has little real consequence anyway. * - * We also also need to remove the snapshots from RegisteredSnapshots - * to prevent a warning below. + * We also need to remove the snapshots from RegisteredSnapshots to + * prevent a warning below. * * As with the FirstXactSnapshot, we don't need to free resources of * the snapshot iself as it will go away with the memory context. diff --git a/src/bin/initdb/t/001_initdb.pl b/src/bin/initdb/t/001_initdb.pl index 599460ca88..5dc629fd5e 100644 --- a/src/bin/initdb/t/001_initdb.pl +++ b/src/bin/initdb/t/001_initdb.pl @@ -1,4 +1,4 @@ -# To test successful data directory creation with a additional feature, first +# To test successful data directory creation with an additional feature, first # try to elaborate the "successful creation" test instead of adding a test. # Successful initdb consumes much time and I/O. diff --git a/src/bin/pg_upgrade/tablespace.c b/src/bin/pg_upgrade/tablespace.c index b0cbf81f7d..6dc8428e7b 100644 --- a/src/bin/pg_upgrade/tablespace.c +++ b/src/bin/pg_upgrade/tablespace.c @@ -34,7 +34,7 @@ init_tablespaces(void) * get_tablespace_paths() * * Scans pg_tablespace and returns a malloc'ed array of all tablespace - * paths. Its the caller's responsibility to free the array. + * paths. It's the caller's responsibility to free the array. */ static void get_tablespace_paths(void) diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index da7f52cab0..20140a35e5 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -676,7 +676,7 @@ typedef struct TupleHashTableData /* The following fields are set transiently for each table search: */ TupleTableSlot *inputslot; /* current input tuple's slot */ FmgrInfo *in_hash_funcs; /* hash functions for input datatype(s) */ - ExprState *cur_eq_func; /* comparator for for input vs. table */ + ExprState *cur_eq_func; /* comparator for input vs. table */ uint32 hash_iv; /* hash-function IV */ ExprContext *exprcontext; /* expression context */ } TupleHashTableData; diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 6390f7e8c1..fb9a5c41be 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -3432,7 +3432,7 @@ typedef struct AlterTSConfigurationStmt typedef struct CreatePublicationStmt { NodeTag type; - char *pubname; /* Name of of the publication */ + char *pubname; /* Name of the publication */ List *options; /* List of DefElem nodes */ List *tables; /* Optional list of tables to add */ bool for_all_tables; /* Special publication for all tables in db */ @@ -3441,7 +3441,7 @@ typedef struct CreatePublicationStmt typedef struct AlterPublicationStmt { NodeTag type; - char *pubname; /* Name of of the publication */ + char *pubname; /* Name of the publication */ /* parameters used for ALTER PUBLICATION ... WITH */ List *options; /* List of DefElem nodes */ @@ -3455,7 +3455,7 @@ typedef struct AlterPublicationStmt typedef struct CreateSubscriptionStmt { NodeTag type; - char *subname; /* Name of of the subscription */ + char *subname; /* Name of the subscription */ char *conninfo; /* Connection string to publisher */ List *publication; /* One or more publication to subscribe to */ List *options; /* List of DefElem nodes */ @@ -3474,7 +3474,7 @@ typedef struct AlterSubscriptionStmt { NodeTag type; AlterSubscriptionType kind; /* ALTER_SUBSCRIPTION_OPTIONS, etc */ - char *subname; /* Name of of the subscription */ + char *subname; /* Name of the subscription */ char *conninfo; /* Connection string to publisher */ List *publication; /* One or more publication to subscribe to */ List *options; /* List of DefElem nodes */ @@ -3483,7 +3483,7 @@ typedef struct AlterSubscriptionStmt typedef struct DropSubscriptionStmt { NodeTag type; - char *subname; /* Name of of the subscription */ + char *subname; /* Name of the subscription */ bool missing_ok; /* Skip error if missing? */ DropBehavior behavior; /* RESTRICT or CASCADE behavior */ } DropSubscriptionStmt; diff --git a/src/include/port/pg_bswap.h b/src/include/port/pg_bswap.h index 0f09c05d6f..5b05a6d297 100644 --- a/src/include/port/pg_bswap.h +++ b/src/include/port/pg_bswap.h @@ -102,7 +102,7 @@ pg_bswap64(uint64 x) /* - * Portable and fast equivalents for for ntohs, ntohl, htons, htonl, + * Portable and fast equivalents for ntohs, ntohl, htons, htonl, * additionally extended to 64 bits. */ #ifdef WORDS_BIGENDIAN diff --git a/src/include/storage/latch.h b/src/include/storage/latch.h index a4bcb48874..fd8735b7f5 100644 --- a/src/include/storage/latch.h +++ b/src/include/storage/latch.h @@ -129,7 +129,7 @@ typedef struct Latch #ifdef WIN32 #define WL_SOCKET_CONNECTED (1 << 5) #else -/* avoid having to to deal with case on platforms not requiring it */ +/* avoid having to deal with case on platforms not requiring it */ #define WL_SOCKET_CONNECTED WL_SOCKET_WRITEABLE #endif diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index c97f9d1b43..6ecbdb6294 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -218,7 +218,7 @@ typedef struct ForeignKeyCacheInfo } ForeignKeyCacheInfo; /* - * Options common for all all indexes + * Options common for all indexes */ typedef struct GenericIndexOpts { diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c index c1b44d36f2..f5d0359cc2 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -1309,8 +1309,8 @@ ecpg_build_params(struct statement *stmt) if ((position = next_insert(stmt->command, position, stmt->questionmarks, std_strings) + 1) == 0) { /* - * We have an argument but we dont have the matched up placeholder - * in the string + * We have an argument but we don't have the matched up + * placeholder in the string */ ecpg_raise(stmt->lineno, ECPG_TOO_MANY_ARGUMENTS, ECPG_SQLSTATE_USING_CLAUSE_DOES_NOT_MATCH_PARAMETERS, diff --git a/src/interfaces/ecpg/preproc/parse.pl b/src/interfaces/ecpg/preproc/parse.pl index b20383ab17..ad87aad283 100644 --- a/src/interfaces/ecpg/preproc/parse.pl +++ b/src/interfaces/ecpg/preproc/parse.pl @@ -144,7 +144,7 @@ sub main # flds are the fields to use. These may start with a '$' - in # which case they are the result of a previous non-terminal # - # if they dont start with a '$' then they are token name + # if they don't start with a '$' then they are token name # # len is the number of fields in flds... # leadin is the padding to apply at the beginning (just use for formatting) @@ -223,7 +223,7 @@ sub main next line; } - # Dont worry about anything if we're not in the right section of gram.y + # Don't worry about anything if we're not in the right section of gram.y if ($yaccmode != 1) { next line; diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c index 12f7b13780..e2fa43b890 100644 --- a/src/pl/tcl/pltcl.c +++ b/src/pl/tcl/pltcl.c @@ -2762,7 +2762,7 @@ pltcl_SPI_execute_plan(ClientData cdata, Tcl_Interp *interp, } /************************************************************ - * If there was a argtype list on preparation, we need + * If there was an argtype list on preparation, we need * an argument value list now ************************************************************/ if (qdesc->nargs > 0) diff --git a/src/test/regress/expected/rowsecurity.out b/src/test/regress/expected/rowsecurity.out index f1ae40df61..bc16ca4c43 100644 --- a/src/test/regress/expected/rowsecurity.out +++ b/src/test/regress/expected/rowsecurity.out @@ -2108,7 +2108,7 @@ SET SESSION AUTHORIZATION regress_rls_bob; INSERT INTO document VALUES (79, (SELECT cid from category WHERE cname = 'technology'), 1, 'regress_rls_bob', 'technology book, can only insert') ON CONFLICT (did) DO UPDATE SET dtitle = EXCLUDED.dtitle RETURNING *; ERROR: new row violates row-level security policy for table "document" --- UPDATE path is taken here. Existing tuple passes, since it's cid +-- UPDATE path is taken here. Existing tuple passes, since its cid -- corresponds to "novel", but default USING qual is enforced against -- post-UPDATE tuple too (as always when updating with a policy that lacks an -- explicit WCO), and so this fails: diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index ae0cd253d5..744d501e31 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -2818,7 +2818,7 @@ Rules: NOTIFY rules_src_deletion -- --- Ensure a aliased target relation for insert is correctly deparsed. +-- Ensure an aliased target relation for insert is correctly deparsed. -- create rule r4 as on insert to rules_src do instead insert into rules_log AS trgt SELECT NEW.* RETURNING trgt.f1, trgt.f2; create rule r5 as on update to rules_src do instead UPDATE rules_log AS trgt SET tag = 'updated' WHERE trgt.f1 = new.f1; diff --git a/src/test/regress/sql/rowsecurity.sql b/src/test/regress/sql/rowsecurity.sql index f3a31dbee0..5a9fdcad74 100644 --- a/src/test/regress/sql/rowsecurity.sql +++ b/src/test/regress/sql/rowsecurity.sql @@ -781,7 +781,7 @@ SET SESSION AUTHORIZATION regress_rls_bob; INSERT INTO document VALUES (79, (SELECT cid from category WHERE cname = 'technology'), 1, 'regress_rls_bob', 'technology book, can only insert') ON CONFLICT (did) DO UPDATE SET dtitle = EXCLUDED.dtitle RETURNING *; --- UPDATE path is taken here. Existing tuple passes, since it's cid +-- UPDATE path is taken here. Existing tuple passes, since its cid -- corresponds to "novel", but default USING qual is enforced against -- post-UPDATE tuple too (as always when updating with a policy that lacks an -- explicit WCO), and so this fails: diff --git a/src/test/regress/sql/rules.sql b/src/test/regress/sql/rules.sql index a82f52d154..3ca4c07356 100644 --- a/src/test/regress/sql/rules.sql +++ b/src/test/regress/sql/rules.sql @@ -1007,7 +1007,7 @@ create rule r3 as on delete to rules_src do notify rules_src_deletion; \d+ rules_src -- --- Ensure a aliased target relation for insert is correctly deparsed. +-- Ensure an aliased target relation for insert is correctly deparsed. -- create rule r4 as on insert to rules_src do instead insert into rules_log AS trgt SELECT NEW.* RETURNING trgt.f1, trgt.f2; create rule r5 as on update to rules_src do instead UPDATE rules_log AS trgt SET tag = 'updated' WHERE trgt.f1 = new.f1; -- 2.40.0