Use "superuser" instead of "super user" in code comments

Started by Bharath Rupireddyover 4 years ago4 messages
#1Bharath Rupireddy
bharath.rupireddyforpostgres@gmail.com
1 attachment(s)

Hi,

It seems like we use "superuser" as a standard term across the entire
code base i.e. error messages, docs, code comments. But there are
still a few code comments that use the term "super user". Can we
replace those with "superuser"? Attaching a tiny patch to do that.

Thoughts?

Regards,
Bharath Rupireddy.

Attachments:

v1-0001-Use-superuser-instead-of-super-user-in-code-comme.patchapplication/octet-stream; name=v1-0001-Use-superuser-instead-of-super-user-in-code-comme.patchDownload
From a40f03bb034c9d6a78f8585c595f39d419a0cab7 Mon Sep 17 00:00:00 2001
From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Date: Tue, 7 Sep 2021 12:42:22 +0000
Subject: [PATCH v1] Use "superuser" instead of "super user" in code comments
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The term "superuser" is used as a standard across the entire code
base i.e. error messages, docs, code comments. But there are still
a few code comments that use the term "super user".

This patch replaces those with "superuser".
---
 src/backend/commands/amcmds.c      | 2 +-
 src/backend/commands/foreigncmds.c | 4 ++--
 src/backend/commands/tablespace.c  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/backend/commands/amcmds.c b/src/backend/commands/amcmds.c
index 188109e474..72e209a8b0 100644
--- a/src/backend/commands/amcmds.c
+++ b/src/backend/commands/amcmds.c
@@ -53,7 +53,7 @@ CreateAccessMethod(CreateAmStmt *stmt)
 
 	rel = table_open(AccessMethodRelationId, RowExclusiveLock);
 
-	/* Must be super user */
+	/* Must be superuser */
 	if (!superuser())
 		ereport(ERROR,
 				(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
diff --git a/src/backend/commands/foreigncmds.c b/src/backend/commands/foreigncmds.c
index 9b71beb1d3..146fa5733f 100644
--- a/src/backend/commands/foreigncmds.c
+++ b/src/backend/commands/foreigncmds.c
@@ -573,7 +573,7 @@ CreateForeignDataWrapper(ParseState *pstate, CreateFdwStmt *stmt)
 
 	rel = table_open(ForeignDataWrapperRelationId, RowExclusiveLock);
 
-	/* Must be super user */
+	/* Must be superuser */
 	if (!superuser())
 		ereport(ERROR,
 				(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
@@ -690,7 +690,7 @@ AlterForeignDataWrapper(ParseState *pstate, AlterFdwStmt *stmt)
 
 	rel = table_open(ForeignDataWrapperRelationId, RowExclusiveLock);
 
-	/* Must be super user */
+	/* Must be superuser */
 	if (!superuser())
 		ereport(ERROR,
 				(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c
index 932e7ae37b..4b96eec9df 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -242,7 +242,7 @@ CreateTableSpace(CreateTableSpaceStmt *stmt)
 	Oid			ownerId;
 	Datum		newOptions;
 
-	/* Must be super user */
+	/* Must be superuser */
 	if (!superuser())
 		ereport(ERROR,
 				(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
-- 
2.25.1

#2Daniel Gustafsson
daniel@yesql.se
In reply to: Bharath Rupireddy (#1)
Re: Use "superuser" instead of "super user" in code comments

On 7 Sep 2021, at 14:44, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote:

It seems like we use "superuser" as a standard term across the entire
code base i.e. error messages, docs, code comments. But there are
still a few code comments that use the term "super user". Can we
replace those with "superuser"? Attaching a tiny patch to do that.

Good catch, superuser is the term we should use for this. There is one
additional “super user” in src/test/regress/sql/conversion.sql (and its
corresponding resultfile) which can be included in this. Unless there are
objections I’ll apply this with the testfile fixup.

--
Daniel Gustafsson https://vmware.com/

#3Bharath Rupireddy
bharath.rupireddyforpostgres@gmail.com
In reply to: Daniel Gustafsson (#2)
1 attachment(s)
Re: Use "superuser" instead of "super user" in code comments

On Tue, Sep 7, 2021 at 6:40 PM Daniel Gustafsson <daniel@yesql.se> wrote:

On 7 Sep 2021, at 14:44, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote:

It seems like we use "superuser" as a standard term across the entire
code base i.e. error messages, docs, code comments. But there are
still a few code comments that use the term "super user". Can we
replace those with "superuser"? Attaching a tiny patch to do that.

Good catch, superuser is the term we should use for this. There is one
additional “super user” in src/test/regress/sql/conversion.sql (and its
corresponding resultfile) which can be included in this. Unless there are
objections I’ll apply this with the testfile fixup.

Thanks for picking this up. Here's v2 including the change in
conversion.sql and .out.

Regards,
Bharath Rupireddy.

Attachments:

v2-0001-Use-superuser-instead-of-super-user-in-code-comme.patchapplication/octet-stream; name=v2-0001-Use-superuser-instead-of-super-user-in-code-comme.patchDownload
From 30aa6ad8cb95955e18fd287ba957f332b4b3ef7b Mon Sep 17 00:00:00 2001
From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Date: Tue, 7 Sep 2021 13:45:50 +0000
Subject: [PATCH v2] Use "superuser" instead of "super user" in code comments

The term "superuser" is used as a standard across the entire code
base i.e. error messages, docs, code comments. But there are still
a few code comments that use the term "super user".

This patch replaces those with "superuser".
---
 src/backend/commands/amcmds.c            | 2 +-
 src/backend/commands/foreigncmds.c       | 4 ++--
 src/backend/commands/tablespace.c        | 2 +-
 src/test/regress/expected/conversion.out | 2 +-
 src/test/regress/sql/conversion.sql      | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/backend/commands/amcmds.c b/src/backend/commands/amcmds.c
index 188109e474..72e209a8b0 100644
--- a/src/backend/commands/amcmds.c
+++ b/src/backend/commands/amcmds.c
@@ -53,7 +53,7 @@ CreateAccessMethod(CreateAmStmt *stmt)
 
 	rel = table_open(AccessMethodRelationId, RowExclusiveLock);
 
-	/* Must be super user */
+	/* Must be superuser */
 	if (!superuser())
 		ereport(ERROR,
 				(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
diff --git a/src/backend/commands/foreigncmds.c b/src/backend/commands/foreigncmds.c
index 9b71beb1d3..146fa5733f 100644
--- a/src/backend/commands/foreigncmds.c
+++ b/src/backend/commands/foreigncmds.c
@@ -573,7 +573,7 @@ CreateForeignDataWrapper(ParseState *pstate, CreateFdwStmt *stmt)
 
 	rel = table_open(ForeignDataWrapperRelationId, RowExclusiveLock);
 
-	/* Must be super user */
+	/* Must be superuser */
 	if (!superuser())
 		ereport(ERROR,
 				(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
@@ -690,7 +690,7 @@ AlterForeignDataWrapper(ParseState *pstate, AlterFdwStmt *stmt)
 
 	rel = table_open(ForeignDataWrapperRelationId, RowExclusiveLock);
 
-	/* Must be super user */
+	/* Must be superuser */
 	if (!superuser())
 		ereport(ERROR,
 				(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c
index 932e7ae37b..4b96eec9df 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -242,7 +242,7 @@ CreateTableSpace(CreateTableSpaceStmt *stmt)
 	Oid			ownerId;
 	Datum		newOptions;
 
-	/* Must be super user */
+	/* Must be superuser */
 	if (!superuser())
 		ereport(ERROR,
 				(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
diff --git a/src/test/regress/expected/conversion.out b/src/test/regress/expected/conversion.out
index 04fdcba496..5c9d631755 100644
--- a/src/test/regress/expected/conversion.out
+++ b/src/test/regress/expected/conversion.out
@@ -33,7 +33,7 @@ DROP CONVERSION mydef;
 -- so there's no need to do that here.
 --
 --
--- return to the super user
+-- return to the superuser
 --
 RESET SESSION AUTHORIZATION;
 DROP USER regress_conversion_user;
diff --git a/src/test/regress/sql/conversion.sql b/src/test/regress/sql/conversion.sql
index 8358682432..5576999e42 100644
--- a/src/test/regress/sql/conversion.sql
+++ b/src/test/regress/sql/conversion.sql
@@ -30,7 +30,7 @@ DROP CONVERSION mydef;
 -- so there's no need to do that here.
 --
 --
--- return to the super user
+-- return to the superuser
 --
 RESET SESSION AUTHORIZATION;
 DROP USER regress_conversion_user;
-- 
2.25.1

#4Daniel Gustafsson
daniel@yesql.se
In reply to: Bharath Rupireddy (#3)
Re: Use "superuser" instead of "super user" in code comments

On 7 Sep 2021, at 15:48, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote:

On Tue, Sep 7, 2021 at 6:40 PM Daniel Gustafsson <daniel@yesql.se> wrote:

On 7 Sep 2021, at 14:44, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote:

It seems like we use "superuser" as a standard term across the entire
code base i.e. error messages, docs, code comments. But there are
still a few code comments that use the term "super user". Can we
replace those with "superuser"? Attaching a tiny patch to do that.

Good catch, superuser is the term we should use for this. There is one
additional “super user” in src/test/regress/sql/conversion.sql (and its
corresponding resultfile) which can be included in this. Unless there are
objections I’ll apply this with the testfile fixup.

Thanks for picking this up. Here's v2 including the change in
conversion.sql and .out.

Done, thanks!

--
Daniel Gustafsson https://vmware.com/