Re: [HACKERS] Fix typos in comments

2016-03-15 Thread Robert Haas
On Tue, Mar 15, 2016 at 5:48 PM, Oskari Saarenmaa  wrote:
> Attached a patch to fix a bunch of typos in comments.

Committed.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] Fix typos in comments

2016-03-15 Thread Oskari Saarenmaa

Attached a patch to fix a bunch of typos in comments.

/ Oskari
>From 1effab7d75c3ac08257c637d8662b4c8b3fdc750 Mon Sep 17 00:00:00 2001
From: Oskari Saarenmaa 
Date: Tue, 15 Mar 2016 23:45:26 +0200
Subject: [PATCH] misc typofixes in comments

---
 contrib/pgcrypto/sha1.h| 2 +-
 contrib/sepgsql/label.c| 2 +-
 doc/src/sgml/sources.sgml  | 2 +-
 src/backend/access/transam/twophase.c  | 2 +-
 src/backend/libpq/auth.c   | 4 ++--
 src/backend/optimizer/util/relnode.c   | 2 +-
 src/backend/parser/parse_target.c  | 2 +-
 src/backend/storage/buffer/bufmgr.c| 2 +-
 src/backend/storage/ipc/dsm_impl.c | 2 +-
 src/backend/storage/ipc/procarray.c| 2 +-
 src/backend/storage/ipc/shm_mq.c   | 2 +-
 src/backend/utils/adt/json.c   | 2 +-
 src/backend/utils/adt/windowfuncs.c| 2 +-
 src/backend/utils/misc/guc.c   | 4 ++--
 src/bin/pg_dump/compress_io.c  | 2 +-
 src/bin/pg_dump/parallel.c | 2 +-
 src/bin/pg_upgrade/option.c| 2 +-
 src/bin/pgbench/pgbench.c  | 2 +-
 src/include/storage/shm_toc.h  | 2 +-
 src/interfaces/ecpg/ecpglib/execute.c  | 2 +-
 src/interfaces/ecpg/preproc/parse.pl   | 2 +-
 src/interfaces/ecpg/preproc/type.c | 2 +-
 src/test/regress/expected/inherit.out  | 4 ++--
 src/test/regress/expected/replica_identity.out | 2 +-
 src/test/regress/sql/inherit.sql   | 4 ++--
 src/test/regress/sql/replica_identity.sql  | 2 +-
 26 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/contrib/pgcrypto/sha1.h b/contrib/pgcrypto/sha1.h
index 5532ca1..2f61e45 100644
--- a/contrib/pgcrypto/sha1.h
+++ b/contrib/pgcrypto/sha1.h
@@ -63,7 +63,7 @@ extern void sha1_pad(struct sha1_ctxt *);
 extern void sha1_loop(struct sha1_ctxt *, const uint8 *, size_t);
 extern void sha1_result(struct sha1_ctxt *, uint8 *);
 
-/* compatibilty with other SHA1 source codes */
+/* compatibility with other SHA1 source codes */
 typedef struct sha1_ctxt SHA1_CTX;
 
 #define SHA1Init(x)		sha1_init((x))
diff --git a/contrib/sepgsql/label.c b/contrib/sepgsql/label.c
index 3e32f1b..e12a0e8 100644
--- a/contrib/sepgsql/label.c
+++ b/contrib/sepgsql/label.c
@@ -161,7 +161,7 @@ sepgsql_set_client_label(const char *new_label)
 /*
  * sepgsql_xact_callback
  *
- * A callback routine of transaction commit/abort/prepare.  Commmit or abort
+ * A callback routine of transaction commit/abort/prepare.  Commit or abort
  * changes in the client_label_pending list.
  */
 static void
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index fcb3e40..614defa 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -860,7 +860,7 @@ BETTER: unrecognized node type: 42
  Code in PostgreSQL should only rely on language
  features available in the C89 standard. That means a conforming
  C89 compiler has to be able to compile postgres, at least aside
- from a few platform dependant pieces. Features from later
+ from a few platform dependent pieces. Features from later
  revision of the C standard or compiler specific features can be
  used, if a fallback is provided.
 
diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c
index c4fd9ef..e7234c8 100644
--- a/src/backend/access/transam/twophase.c
+++ b/src/backend/access/transam/twophase.c
@@ -1613,7 +1613,7 @@ CheckPointTwoPhase(XLogRecPtr redo_horizon)
 	 * transaction manager isn't active.
 	 *
 	 * It's also possible to move I/O out of the lock, but on
-	 * every error we should check whether somebody commited our
+	 * every error we should check whether somebody committed our
 	 * transaction in different backend. Let's leave this optimisation
 	 * for future, if somebody will spot that this place cause
 	 * bottleneck.
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index 57c2f48..7f1ae8c 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -838,7 +838,7 @@ pg_GSS_recvauth(Port *port)
 
 	/*
 	 * Loop through GSSAPI message exchange. This exchange can consist of
-	 * multiple messags sent in both directions. First message is always from
+	 * multiple messages sent in both directions. First message is always from
 	 * the client. All messages from client to server are password packets
 	 * (type 'p').
 	 */
@@ -1078,7 +1078,7 @@ pg_SSPI_recvauth(Port *port)
 
 	/*
 	 * Loop through SSPI message exchange. This exchange can consist of
-	 * multiple messags sent in both directions. First message is always from
+	 * multiple messages sent in both directions. First message is always from
 	 * the client. All messages from client to server are password packets
 	 * (type 'p').
 	 */
diff --git a/src/backend/optimizer/util/relnode.c b/src/ba

Re: [HACKERS] fix typos in comments

2015-04-26 Thread Andres Freund
On 2015-04-26 13:03:52 -0400, Tom Lane wrote:
> Andres Freund  writes:
> > On 2015-04-26 12:53:30 -0400, Tom Lane wrote:
> >> Hm.  My dictionary says that "therefor" is archaic, but to my eye it
> >> looks just wrong.  Certainly no modern writer would spell it like that.
> 
> > Mine said that it's still common in some circles, particularly the law,
> > so I thought I'd leave it alone.  I don't have that much of a 'feeling'
> > for english, strangely enough.
> 
> Well, a quick grep says that our source tree contains 2 occurrences of
> "therefor" (in pqcomm.c and geqo_erx.c), versus 700+ occurrences of
> "therefore".  So I'd be inclined to standardize on the latter.

Done.

Greetings,

Andres Freund


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] fix typos in comments

2015-04-26 Thread Tom Lane
Andres Freund  writes:
> On 2015-04-26 12:53:30 -0400, Tom Lane wrote:
>> Hm.  My dictionary says that "therefor" is archaic, but to my eye it
>> looks just wrong.  Certainly no modern writer would spell it like that.

> Mine said that it's still common in some circles, particularly the law,
> so I thought I'd leave it alone.  I don't have that much of a 'feeling'
> for english, strangely enough.

Well, a quick grep says that our source tree contains 2 occurrences of
"therefor" (in pqcomm.c and geqo_erx.c), versus 700+ occurrences of
"therefore".  So I'd be inclined to standardize on the latter.

regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] fix typos in comments

2015-04-26 Thread Andres Freund
On 2015-04-26 12:53:30 -0400, Tom Lane wrote:
> Andres Freund  writes:
> > On 2015-04-26 19:13:42 +0400, Dmitriy Olshevskiy wrote:
> >> - *  therefor it is up to the calling routine to
> >> + *  therefore it is up to the calling routine to
> 
> > I think both are actually legal? Yes therefore is more common, but
> > still.
> 
> Hm.  My dictionary says that "therefor" is archaic, but to my eye it
> looks just wrong.  Certainly no modern writer would spell it like that.

Mine said that it's still common in some circles, particularly the law,
so I thought I'd leave it alone.  I don't have that much of a 'feeling'
for english, strangely enough.

Greetings,

Andres Freund


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] fix typos in comments

2015-04-26 Thread Tom Lane
Andres Freund  writes:
> On 2015-04-26 19:13:42 +0400, Dmitriy Olshevskiy wrote:
>> - *therefor it is up to the calling routine to
>> + *therefore it is up to the calling routine to

> I think both are actually legal? Yes therefore is more common, but
> still.

Hm.  My dictionary says that "therefor" is archaic, but to my eye it
looks just wrong.  Certainly no modern writer would spell it like that.

> Nope. Iff means "if and only if".

Right, "iff" is intentional here (and in many other places).  We've
discussed that before.

regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] fix typos in comments

2015-04-26 Thread Andres Freund
Hi,

Man, whoever invented these an vs. a rules... But then this patch made
me lookup the rules ;)

On 2015-04-26 19:13:42 +0400, Dmitriy Olshevskiy wrote:

> diff --git a/src/backend/optimizer/geqo/geqo_erx.c 
> b/src/backend/optimizer/geqo/geqo_erx.c
> index 69ac077..1a43ab7 100644
> --- a/src/backend/optimizer/geqo/geqo_erx.c
> +++ b/src/backend/optimizer/geqo/geqo_erx.c
> @@ -138,7 +138,7 @@ gimme_edge_table(PlannerInfo *root, Gene *tour1, Gene 
> *tour2,
>   * registers edge from city1 to city2 in input edge table
>   *
>   * no assumptions about directionality are made;
> - * therefor it is up to the calling routine to
> + * therefore it is up to the calling routine to
>   * call gimme_edge twice to make a bi-directional edge
>   * between city1 and city2;
>   * uni-directional edges are possible as well (just call
> gimme_edge

I think both are actually legal? Yes therefore is more common, but
still.

I left this out.

> diff --git a/src/include/access/attnum.h b/src/include/access/attnum.h
> index 82e811d..300b682 100644
> --- a/src/include/access/attnum.h
> +++ b/src/include/access/attnum.h
> @@ -29,14 +29,14 @@ typedef int16 AttrNumber;
>   */
>  /*
>   * AttributeNumberIsValid
> - *   True iff the attribute number is valid.
> + *   True if the attribute number is valid.
>   */
>  #define AttributeNumberIsValid(attributeNumber) \
>   ((bool) ((attributeNumber) != InvalidAttrNumber))
>  
>  /*
>   * AttrNumberIsForUserDefinedAttr
> - *   True iff the attribute number corresponds to an user defined 
> attribute.
> + *   True if the attribute number corresponds to a user defined 
> attribute.
>   */

Nope. Iff means "if and only if".

> diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
> index f4dc0db..b131412 100644
> --- a/src/include/storage/s_lock.h
> +++ b/src/include/storage/s_lock.h
> @@ -356,8 +356,8 @@ tas(volatile slock_t *lock)
>  /*
>   * Solaris has always run sparc processors in TSO (total store) mode, but
>   * linux didn't use to and the *BSDs still don't. So, be careful about
> - * acquire/release semantics. The CPU will treat superflous membars as NOPs,
> - * so it's just code space.
> + * acquire/release semantics. The CPU will treat superfluous membars as 
> + * NOPs, so it's just code space.
>   */
>  #define HAS_TEST_AND_SET

superflous, err superfluous, trailing space removed.

I've pushed the rest. Thanks!

Greetings,

Andres Freund


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] fix typos in comments

2015-04-26 Thread Dmitriy Olshevskiy

Hello!

Please see this patch with several typos and 
mistakes in comments.


There are also typos in sgml files (duplicate "to"):
1. doc/src/sgml/logicaldecoding.sgml, ln 619
>> Logical decoding can be used to to build
2. doc/src/sgml/ref/pg_dumpall.sgml, ln 457
>> Specifies the name of the database to connect 
to to dump global


--
Dmitriy Olshevskiy

>From 2558366552ce00bff5c57a98dea72f959e3c72e7 Mon Sep 17 00:00:00 2001
From: olshevskiy87 
Date: Sun, 26 Apr 2015 18:40:07 +0400
Subject: [PATCH] fix typos in comments

---
 src/backend/access/brin/brin_tuple.c  | 2 +-
 src/backend/access/nbtree/nbtree.c| 2 +-
 src/backend/access/transam/twophase.c | 2 +-
 src/backend/catalog/objectaddress.c   | 4 ++--
 src/backend/commands/indexcmds.c  | 2 +-
 src/backend/executor/nodeModifyTable.c| 2 +-
 src/backend/libpq/pqcomm.c| 2 +-
 src/backend/optimizer/geqo/geqo_erx.c | 2 +-
 src/backend/postmaster/bgworker.c | 2 +-
 src/backend/replication/logical/snapbuild.c   | 2 +-
 src/backend/storage/lmgr/lwlock.c | 4 ++--
 src/backend/utils/cache/inval.c   | 2 +-
 src/bin/pg_archivecleanup/pg_archivecleanup.c | 2 +-
 src/bin/pg_basebackup/pg_recvlogical.c| 4 ++--
 src/bin/pg_upgrade/parallel.c | 2 +-
 src/bin/pg_upgrade/relfilenode.c  | 2 +-
 src/include/access/attnum.h   | 6 +++---
 src/include/access/xact.h | 2 +-
 src/include/mb/pg_wchar.h | 2 +-
 src/include/storage/s_lock.h  | 4 ++--
 src/interfaces/ecpg/pgtypeslib/datetime.c | 2 +-
 src/interfaces/ecpg/pgtypeslib/numeric.c  | 2 +-
 src/port/pgmkdirp.c   | 2 +-
 23 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/src/backend/access/brin/brin_tuple.c b/src/backend/access/brin/brin_tuple.c
index 93f00f6..08fa998 100644
--- a/src/backend/access/brin/brin_tuple.c
+++ b/src/backend/access/brin/brin_tuple.c
@@ -304,7 +304,7 @@ brin_free_tuple(BrinTuple *tuple)
 }
 
 /*
- * Create an palloc'd copy of a BrinTuple.
+ * Create a palloc'd copy of a BrinTuple.
  */
 BrinTuple *
 brin_copy_tuple(BrinTuple *tuple, Size len)
diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c
index 9a6dcdd..c2d52fa 100644
--- a/src/backend/access/nbtree/nbtree.c
+++ b/src/backend/access/nbtree/nbtree.c
@@ -40,7 +40,7 @@ typedef struct
 	BTSpool*spool;
 
 	/*
-	 * spool2 is needed only when the index is an unique index. Dead tuples
+	 * spool2 is needed only when the index is a unique index. Dead tuples
 	 * are put into spool2 instead of spool in order to avoid uniqueness
 	 * check.
 	 */
diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c
index 3ac339b..d9a3fab 100644
--- a/src/backend/access/transam/twophase.c
+++ b/src/backend/access/transam/twophase.c
@@ -291,7 +291,7 @@ AtAbort_Twophase(void)
 }
 
 /*
- * This is called after we have finished transfering state to the prepared
+ * This is called after we have finished transferring state to the prepared
  * PGXACT entry.
  */
 void
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index 30cb699..816ab50 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -99,7 +99,7 @@ typedef struct
 	AclObjectKind acl_kind;		/* ACL_KIND_* of this object type */
 	bool		is_nsp_name_unique;		/* can the nsp/name combination (or
 		 * name alone, if there's no
-		 * namespace) be considered an unique
+		 * namespace) be considered a unique
 		 * identifier for an object of this
 		 * class? */
 } ObjectPropertyType;
@@ -3200,7 +3200,7 @@ pg_identify_object(PG_FUNCTION_ARGS)
 
 			/*
 			 * We only return the object name if it can be used (together with
-			 * the schema name, if any) as an unique identifier.
+			 * the schema name, if any) as a unique identifier.
 			 */
 			if (get_object_namensp_unique(address.classId))
 			{
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 99acd4a..351d48e 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1051,7 +1051,7 @@ ComputeIndexAttrs(IndexInfo *indexInfo,
  */
 
 /*
- * A expression using mutable functions is probably wrong,
+ * An expression using mutable functions is probably wrong,
  * since if you aren't going to get the same result for the
  * same data every time, it's not clear what the index entries
  * mean at all.
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c
index 06ec82e..31666ed 100644
--- a/src/backend/executor/nodeModifyTable.c
+++ b/src/backend/executor/nodeModifyTable.c
@@ -304,7 +304,7 @@ ExecInsert(TupleTableSlot *slot,
 	 * inserting the record into the heap and all indexes.
 	 *
 	 * ExecWi