Skip to content

Commit 4fc72cc

Browse files
committed
Collection of typo fixes.
Use "a" and "an" correctly, mostly in comments. Two error messages were also fixed (they were just elogs, so no translation work required). Two function comments in pg_proc.h were also fixed. Etsuro Fujita reported one of these, but I found a lot more with grep. Also fix a few other typos spotted while grepping for the a/an typos. For example, "consists out of ..." -> "consists of ...". Plus a "though"/ "through" mixup reported by Euler Taveira. Many of these typos were in old code, which would be nice to backpatch to make future backpatching easier. But much of the code was new, and I didn't feel like crafting separate patches for each branch. So no backpatching.
1 parent f6a54fe commit 4fc72cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+95
-93
lines changed

contrib/isn/isn.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ str2ean(const char *num)
511511
}
512512

513513
/*
514-
* ean2string --- Try to convert an ean13 number to an hyphenated string.
514+
* ean2string --- Try to convert an ean13 number to a hyphenated string.
515515
* Assumes there's enough space in result to hold
516516
* the string (maximum MAXEAN13LEN+1 bytes)
517517
* This doesn't verify for a valid check digit.

contrib/pg_buffercache/pg_buffercache_pages.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pg_buffercache_pages(PG_FUNCTION_ARGS)
142142
LWLockAcquire(BufMappingPartitionLockByIndex(i), LW_SHARED);
143143

144144
/*
145-
* Scan though all the buffers, saving the relevant fields in the
145+
* Scan through all the buffers, saving the relevant fields in the
146146
* fctx->record structure.
147147
*/
148148
for (i = 0; i < NBuffers; i++)

contrib/spi/timetravel.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static EPlan *find_plan(char *ident, EPlan **eplan, int *nplans);
5151
* and all other column values as in new tuple, and insert tuple
5252
* with old data and stop_date eq current date
5353
* ELSE - skip updation of tuple.
54-
* 2. IF an delete affects tuple with stop_date eq INFINITY
54+
* 2. IF a delete affects tuple with stop_date eq INFINITY
5555
* then insert the same tuple with stop_date eq current date
5656
* [ and delete_user eq current user ]
5757
* ELSE - skip deletion of tuple.

contrib/test_decoding/expected/decoding_in_xact.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SELECT txid_current() = 0;
1111
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
1212
ERROR: cannot create logical replication slot in transaction that has performed writes
1313
ROLLBACK;
14-
-- fail because we're creating a slot while in an subxact whose topxact has a xid
14+
-- fail because we're creating a slot while in a subxact whose topxact has an xid
1515
BEGIN;
1616
SELECT txid_current() = 0;
1717
?column?

contrib/test_decoding/specs/ondisk_startup.spec

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ step "s3txid" { BEGIN ISOLATION LEVEL REPEATABLE READ; SELECT txid_current() IS
3636
step "s3c" { COMMIT; }
3737

3838
# Force usage of ondisk snapshot by starting and not finishing a
39-
# transaction with a assigned xid after consistency has been
39+
# transaction with an assigned xid after consistency has been
4040
# reached. In combination with a checkpoint forcing a snapshot to be
4141
# written and a new restart point computed that'll lead to the usage
4242
# of the snapshot.

contrib/test_decoding/sql/decoding_in_xact.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SELECT txid_current() = 0;
77
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
88
ROLLBACK;
99

10-
-- fail because we're creating a slot while in an subxact whose topxact has a xid
10+
-- fail because we're creating a slot while in a subxact whose topxact has an xid
1111
BEGIN;
1212
SELECT txid_current() = 0;
1313
SAVEPOINT barf;

doc/src/sgml/ref/insert.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ INSERT INTO <replaceable class="PARAMETER">table_name</replaceable> [ AS <replac
415415
one or more <replaceable
416416
class="PARAMETER">column_name_index</replaceable> columns and/or
417417
<replaceable class="PARAMETER">expression_index</replaceable>
418-
expressions, and a optional <replaceable class="PARAMETER">
418+
expressions, and an optional <replaceable class="PARAMETER">
419419
index_predicate</replaceable>.
420420
</para>
421421

src/backend/access/brin/brin_pageops.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ brin_evacuate_page(Relation idxRel, BlockNumber pagesPerRange,
492492
/*
493493
* Return a pinned and exclusively locked buffer which can be used to insert an
494494
* index item of size itemsz. If oldbuf is a valid buffer, it is also locked
495-
* (in a order determined to avoid deadlocks.)
495+
* (in an order determined to avoid deadlocks.)
496496
*
497497
* If there's no existing page with enough free space to accomodate the new
498498
* item, the relation is extended. If this happens, *extended is set to true.

src/backend/access/gin/ginbtree.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ ginFindParents(GinBtree btree, GinBtreeStack *stack)
313313
* the parent needs to be updated. (a root split returns true as it doesn't
314314
* need any further action by the caller to complete)
315315
*
316-
* When inserting a downlink to a internal page, 'childbuf' contains the
316+
* When inserting a downlink to an internal page, 'childbuf' contains the
317317
* child page that was split. Its GIN_INCOMPLETE_SPLIT flag will be cleared
318318
* atomically with the insert. Also, the existing item at the given location
319319
* is updated to point to 'updateblkno'.

src/backend/access/gin/ginxlog.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ ginRedoSplit(XLogReaderState *record)
409409

410410
/*
411411
* VACUUM_PAGE record contains simply a full image of the page, similar to
412-
* a XLOG_FPI record.
412+
* an XLOG_FPI record.
413413
*/
414414
static void
415415
ginRedoVacuumPage(XLogReaderState *record)

src/backend/access/heap/heapam.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -5107,7 +5107,7 @@ compute_new_xmax_infomask(TransactionId xmax, uint16 old_infomask,
51075107
/*
51085108
* Subroutine for heap_lock_updated_tuple_rec.
51095109
*
5110-
* Given an hypothetical multixact status held by the transaction identified
5110+
* Given a hypothetical multixact status held by the transaction identified
51115111
* with the given xid, does the current transaction need to wait, fail, or can
51125112
* it continue if it wanted to acquire a lock of the given mode? "needwait"
51135113
* is set to true if waiting is necessary; if it can continue, then
@@ -7139,7 +7139,7 @@ log_heap_update(Relation reln, Buffer oldbuf,
71397139
}
71407140

71417141
/*
7142-
* Perform XLogInsert of a XLOG_HEAP2_NEW_CID record
7142+
* Perform XLogInsert of an XLOG_HEAP2_NEW_CID record
71437143
*
71447144
* This is only used in wal_level >= WAL_LEVEL_LOGICAL, and only for catalog
71457145
* tuples.
@@ -7179,7 +7179,7 @@ log_heap_new_cid(Relation relation, HeapTuple tup)
71797179
*
71807180
* We need to check for LOCK ONLY because multixacts might be
71817181
* transferred to the new tuple in case of FOR KEY SHARE updates in
7182-
* which case there will be a xmax, although the tuple just got
7182+
* which case there will be an xmax, although the tuple just got
71837183
* inserted.
71847184
*/
71857185
if (hdr->t_infomask & HEAP_XMAX_INVALID ||
@@ -7217,7 +7217,7 @@ log_heap_new_cid(Relation relation, HeapTuple tup)
72177217
* Build a heap tuple representing the configured REPLICA IDENTITY to represent
72187218
* the old tuple in a UPDATE or DELETE.
72197219
*
7220-
* Returns NULL if there's no need to log a identity or if there's no suitable
7220+
* Returns NULL if there's no need to log an identity or if there's no suitable
72217221
* key in the Relation relation.
72227222
*/
72237223
static HeapTuple

src/backend/access/heap/rewriteheap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ typedef struct
195195
typedef OldToNewMappingData *OldToNewMapping;
196196

197197
/*
198-
* In-Memory data for a xid that might need logical remapping entries
198+
* In-Memory data for an xid that might need logical remapping entries
199199
* to be logged.
200200
*/
201201
typedef struct RewriteMappingFile

src/backend/access/nbtree/nbtsearch.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ _bt_search(Relation rel, int keysz, ScanKey scankey, bool nextkey,
118118
* In write-mode, allow _bt_moveright to finish any incomplete splits
119119
* along the way. Strictly speaking, we'd only need to finish an
120120
* incomplete split on the leaf page we're about to insert to, not on
121-
* any of the upper levels (they is taken care of in _bt_getstackbuf,
121+
* any of the upper levels (they are taken care of in _bt_getstackbuf,
122122
* if the leaf page is split and we insert to the parent page). But
123123
* this is a good opportunity to finish splits of internal pages too.
124124
*/

src/backend/access/rmgrdesc/xactdesc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "utils/timestamp.h"
2222

2323
/*
24-
* Parse the WAL format of a xact commit and abort records into a easier to
24+
* Parse the WAL format of an xact commit and abort records into an easier to
2525
* understand format.
2626
*
2727
* This routines are in xactdesc.c because they're accessed in backend (when

src/backend/access/transam/commit_ts.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static void WriteSetTimestampXlogRec(TransactionId mainxid, int nsubxids,
122122
* subtrans implementation changes in the future, we might want to revisit the
123123
* decision of storing timestamp info for each subxid.
124124
*
125-
* The do_xlog parameter tells us whether to include a XLog record of this
125+
* The do_xlog parameter tells us whether to include an XLog record of this
126126
* or not. Normal path through RecordTransactionCommit() will be related
127127
* to a transaction commit XLog record, and so should pass "false" here.
128128
* Other callers probably want to pass true, so that the given values persist

src/backend/access/transam/xact.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static TransactionStateData TopTransactionStateData = {
221221

222222
/*
223223
* unreportedXids holds XIDs of all subtransactions that have not yet been
224-
* reported in a XLOG_XACT_ASSIGNMENT record.
224+
* reported in an XLOG_XACT_ASSIGNMENT record.
225225
*/
226226
static int nUnreportedXids;
227227
static TransactionId unreportedXids[PGPROC_MAX_CACHED_SUBXIDS];
@@ -532,7 +532,7 @@ AssignTransactionId(TransactionState s)
532532
/*
533533
* When wal_level=logical, guarantee that a subtransaction's xid can only
534534
* be seen in the WAL stream if its toplevel xid has been logged before.
535-
* If necessary we log a xact_assignment record with fewer than
535+
* If necessary we log an xact_assignment record with fewer than
536536
* PGPROC_MAX_CACHED_SUBXIDS. Note that it is fine if didLogXid isn't set
537537
* for a transaction even though it appears in a WAL record, we just might
538538
* superfluously log something. That can happen when an xid is included
@@ -1232,8 +1232,8 @@ RecordTransactionCommit(void)
12321232
* Check if we want to commit asynchronously. We can allow the XLOG flush
12331233
* to happen asynchronously if synchronous_commit=off, or if the current
12341234
* transaction has not performed any WAL-logged operation or didn't assign
1235-
* a xid. The transaction can end up not writing any WAL, even if it has
1236-
* a xid, if it only wrote to temporary and/or unlogged tables. It can
1235+
* an xid. The transaction can end up not writing any WAL, even if it has
1236+
* an xid, if it only wrote to temporary and/or unlogged tables. It can
12371237
* end up having written WAL without an xid if it did HOT pruning. In
12381238
* case of a crash, the loss of such a transaction will be irrelevant;
12391239
* temp tables will be lost anyway, unlogged tables will be truncated and
@@ -1305,7 +1305,7 @@ RecordTransactionCommit(void)
13051305
/*
13061306
* Wait for synchronous replication, if required. Similar to the decision
13071307
* above about using committing asynchronously we only want to wait if
1308-
* this backend assigned a xid and wrote WAL. No need to wait if a xid
1308+
* this backend assigned an xid and wrote WAL. No need to wait if an xid
13091309
* was assigned due to temporary/unlogged tables or due to HOT pruning.
13101310
*
13111311
* Note that at this stage we have marked clog, but still show as running

src/backend/access/transam/xlog.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8832,7 +8832,7 @@ CreateRestartPoint(int flags)
88328832
}
88338833

88348834
/*
8835-
* Due to an historical accident multixact truncations are not WAL-logged,
8835+
* Due to a historical accident multixact truncations are not WAL-logged,
88368836
* but just performed everytime the mxact horizon is increased. So, unless
88378837
* we explicitly execute truncations on a standby it will never clean out
88388838
* /pg_multixact which obviously is bad, both because it uses space and

src/backend/catalog/catalog.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ IsCatalogClass(Oid relid, Form_pg_class reltuple)
117117
* We could instead check whether the relation is pinned in pg_depend, but
118118
* this is noticeably cheaper and doesn't require catalog access.
119119
*
120-
* This test is safe since even a oid wraparound will preserve this
120+
* This test is safe since even an oid wraparound will preserve this
121121
* property (c.f. GetNewObjectId()) and it has the advantage that it works
122122
* correctly even if a user decides to create a relation in the pg_catalog
123123
* namespace.

src/backend/catalog/storage.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence)
119119
}
120120

121121
/*
122-
* Perform XLogInsert of a XLOG_SMGR_CREATE record to WAL.
122+
* Perform XLogInsert of an XLOG_SMGR_CREATE record to WAL.
123123
*/
124124
void
125125
log_smgrcreate(RelFileNode *rnode, ForkNumber forkNum)

src/backend/commands/copy.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3346,7 +3346,7 @@ CopyReadLineText(CopyState cstate)
33463346
* just use the char as a toggle. If they are different, we need
33473347
* to ensure that we only take account of an escape inside a
33483348
* quoted field and immediately preceding a quote char, and not
3349-
* the second in a escape-escape sequence.
3349+
* the second in an escape-escape sequence.
33503350
*/
33513351
if (in_quote && c == escapec)
33523352
last_was_esc = !last_was_esc;

src/backend/commands/event_trigger.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,7 @@ EventTriggerCollectAlterTableSubcmd(Node *subcmd, ObjectAddress address)
17711771
* EventTriggerAlterTableEnd
17721772
* Finish up saving an ALTER TABLE command, and add it to command list.
17731773
*
1774-
* FIXME this API isn't considering the possibility that a xact/subxact is
1774+
* FIXME this API isn't considering the possibility that an xact/subxact is
17751775
* aborted partway through. Probably it's best to add an
17761776
* AtEOSubXact_EventTriggers() to fix this.
17771777
*/

src/backend/commands/sequence.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,8 @@ nextval_internal(Oid relid)
703703
/*
704704
* If something needs to be WAL logged, acquire an xid, so this
705705
* transaction's commit will trigger a WAL flush and wait for
706-
* syncrep. It's sufficient to ensure the toplevel transaction has a xid,
707-
* no need to assign xids subxacts, that'll already trigger a appropriate
706+
* syncrep. It's sufficient to ensure the toplevel transaction has an xid,
707+
* no need to assign xids subxacts, that'll already trigger an appropriate
708708
* wait. (Have to do that here, so we're outside the critical section)
709709
*/
710710
if (logit && RelationNeedsWAL(seqrel))

src/backend/commands/tablecmds.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2342,7 +2342,7 @@ RangeVarCallbackForRenameAttribute(const RangeVar *rv, Oid relid, Oid oldrelid,
23422342
}
23432343

23442344
/*
2345-
* renameatt - changes the name of a attribute in a relation
2345+
* renameatt - changes the name of an attribute in a relation
23462346
*
23472347
* The returned ObjectAddress is that of the renamed column.
23482348
*/

src/backend/executor/execIndexing.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* Speculative insertion
5454
* ---------------------
5555
*
56-
* Speculative insertion is a is a two-phase mechanism, used to implement
56+
* Speculative insertion is a two-phase mechanism used to implement
5757
* INSERT ... ON CONFLICT DO UPDATE/NOTHING. The tuple is first inserted
5858
* to the heap and update the indexes as usual, but if a constraint is
5959
* violated, we can still back out the insertion without aborting the whole

src/backend/optimizer/README

+1-1
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ EquivalenceClasses and PathKeys after query_planner has completed.
656656
In these cases, the extra ECs/PKs are needed to represent sort orders
657657
that were not considered during query_planner. Such situations should be
658658
minimized since it is impossible for query_planner to return a plan
659-
producing such a sort order, meaning a explicit sort will always be needed.
659+
producing such a sort order, meaning an explicit sort will always be needed.
660660
Currently this happens only for queries involving multiple window functions
661661
with different orderings, for which extra sorts are needed anyway.
662662

src/backend/optimizer/path/indxpath.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3968,7 +3968,7 @@ prefix_quals(Node *leftop, Oid opfamily, Oid collation,
39683968
}
39693969

39703970
/*
3971-
* Given a leftop and a rightop, and a inet-family sup/sub operator,
3971+
* Given a leftop and a rightop, and an inet-family sup/sub operator,
39723972
* generate suitable indexqual condition(s). expr_op is the original
39733973
* operator, and opfamily is the index opfamily.
39743974
*/

src/backend/parser/gram.y

+2-2
Original file line numberDiff line numberDiff line change
@@ -9484,8 +9484,8 @@ InsertStmt:
94849484

94859485
/*
94869486
* Can't easily make AS optional here, because VALUES in insert_rest would
9487-
* have a shift/reduce conflict with a values as a optional alias. We could
9488-
* easily allow unreserved_keywords as optional aliases, but that'd be a odd
9487+
* have a shift/reduce conflict with a values as an optional alias. We could
9488+
* easily allow unreserved_keywords as optional aliases, but that'd be an odd
94899489
* divergance from other places. So just require AS for now.
94909490
*/
94919491
insert_target:

src/backend/port/atomics.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pg_atomic_init_flag_impl(volatile pg_atomic_flag *ptr)
5252
#ifndef HAVE_SPINLOCKS
5353
/*
5454
* NB: If we're using semaphore based TAS emulation, be careful to use a
55-
* separate set of semaphores. Otherwise we'd get in trouble if a atomic
55+
* separate set of semaphores. Otherwise we'd get in trouble if an atomic
5656
* var would be manipulated while spinlock is held.
5757
*/
5858
s_init_lock_sema((slock_t *) &ptr->sema, true);

src/backend/replication/basebackup.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir)
443443
/*
444444
* Mark file as archived, otherwise files can get archived again
445445
* after promotion of a new node. This is in line with
446-
* walreceiver.c always doing a XLogArchiveForceDone() after a
446+
* walreceiver.c always doing an XLogArchiveForceDone() after a
447447
* complete segment.
448448
*/
449449
StatusFilePath(pathbuf, walFiles[i], ".done");

src/backend/replication/logical/logical.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ StartupDecodingContext(List *output_plugin_options,
149149
* replication slots.
150150
*
151151
* We can only do so if we're outside of a transaction (i.e. the case when
152-
* streaming changes via walsender), otherwise a already setup
152+
* streaming changes via walsender), otherwise an already setup
153153
* snapshot/xid would end up being ignored. That's not a particularly
154154
* bothersome restriction since the SQL interface can't be used for
155155
* streaming anyway.
@@ -225,7 +225,7 @@ CreateInitDecodingContext(char *plugin,
225225

226226
/* first some sanity checks that are unlikely to be violated */
227227
if (slot == NULL)
228-
elog(ERROR, "cannot perform logical decoding without a acquired slot");
228+
elog(ERROR, "cannot perform logical decoding without an acquired slot");
229229

230230
if (plugin == NULL)
231231
elog(ERROR, "cannot initialize logical decoding without a specified plugin");
@@ -377,7 +377,7 @@ CreateDecodingContext(XLogRecPtr start_lsn,
377377

378378
/* first some sanity checks that are unlikely to be violated */
379379
if (slot == NULL)
380-
elog(ERROR, "cannot perform logical decoding without a acquired slot");
380+
elog(ERROR, "cannot perform logical decoding without an acquired slot");
381381

382382
/* make sure the passed slot is suitable, these are user facing errors */
383383
if (slot->data.database == InvalidOid)
@@ -436,7 +436,7 @@ CreateDecodingContext(XLogRecPtr start_lsn,
436436
}
437437

438438
/*
439-
* Returns true if an consistent initial decoding snapshot has been built.
439+
* Returns true if a consistent initial decoding snapshot has been built.
440440
*/
441441
bool
442442
DecodingContextReady(LogicalDecodingContext *ctx)

src/backend/replication/logical/logicalfuncs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ typedef struct DecodingOutputState
5353
} DecodingOutputState;
5454

5555
/*
56-
* Prepare for a output plugin write.
56+
* Prepare for an output plugin write.
5757
*/
5858
static void
5959
LogicalOutputPrepareWrite(LogicalDecodingContext *ctx, XLogRecPtr lsn, TransactionId xid,

0 commit comments

Comments
 (0)