language.txt

text/plain

Filename: language.txt
Type: text/plain
Part: 0
Message: Re: Schema variables - new implementation for Postgres 15
diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c
index d4d1d104198..adc8b21a595 100644
--- a/src/backend/catalog/namespace.c
+++ b/src/backend/catalog/namespace.c
@@ -3398,12 +3398,11 @@ NamesFromList(List *names)
  * variable name and attribute name, and we count valid combinations.
  *
  * Returns oid of identified variable. When last field of names list is
- * identified as an attribute, then output attrname argument is set to
- * an string of this field.
+ * identified as an attribute, then the argument attrname contains the name of
+ * this field.
  *
- * When there is not any valid combination, then we are sure, so the
- * list of names cannot to identify any session variable. In this case
- * we return InvalidOid.
+ * When there is is no valid combinations, we can be sure the specified list of
+ * names cannot identify a session variable. In this case we return InvalidOid.
  *
  * We can find more valid combination than one.
  * Example: users can have session variable x in schema y, and
diff --git a/src/backend/commands/session_variable.c b/src/backend/commands/session_variable.c
index 88957bd6624..06c6d49c491 100644
--- a/src/backend/commands/session_variable.c
+++ b/src/backend/commands/session_variable.c
@@ -51,10 +51,10 @@ typedef struct SVariableXActDropItem
  * Values of session variables are stored in the backend local memory
  * inside sessionvars hash table in binary format inside a dedicated memory
  * context SVariableMemoryContext.  The hash key is oid
- * of related entry in pg_variable table. But unambiguity of oid is
- * not guaranteed (in long time). There can be long time not active
- * session with stored value identified by one oid, and in other session
- * related variable can be dropped, assigned oid can be released, and
+ * of related entry in pg_variable table. But long term unambiguity of oid is
+ * not guaranteed. As an example, for a value with one oid a session can be
+ * inactive for long time, while in the meantime the related session varibale
+ * can be dropped in another session, assigned oid can be released, and
  * theoreticaly this oid can be assigned to different session variable.
  * At the end, the reading of value stored in old session should to fail,
  * because related entry in pg_variable will not be consistent with
@@ -356,11 +356,11 @@ is_session_variable_valid(SVariable svar)
 }
 
 /*
- * It does check all possibly invalid entries against the system catalog.
+ * It checks all possibly invalid entries against the system catalog.
  * During this validation, the system cache can be invalidated, and the
  * some sinval message can be accepted. This routine doesn't ensure
  * all living entries of sessionvars will have is_valid flag, but it ensures
- * so all entries are checked once.
+ * that all entries are checked once.
  *
  * This routine can be called somewhere inside transaction or at an transaction
  * end. When atEOX argument is false, then we are inside transaction, and we
@@ -383,7 +383,7 @@ remove_invalid_session_variables(bool atEOX)
 		return;
 
 	/*
-	 * Reset, this flag here, before we start the validation. It can be set to
+	 * Reset this flag here, before we start the validation. It can be set to
 	 * on by incomming sinval message.
 	 */
 	needs_validation = false;
@@ -732,8 +732,8 @@ set_session_variable(SVariable svar, Datum value, bool isnull)
 	 * trustable (the invalidation message was not accepted for this variable).
 	 * When the variable is possibly invalid, force setup.
 	 *
-	 * Do not it against passed svar, it should be unchanged, when an assignment
-	 * is not successful (the datumCopy can fail).
+	 * Do not do it against passed svar, it should be unchanged, when an
+	 * assignment is not successful (the datumCopy can fail).
 	 */
 	if (!svar->is_valid)
 	{
@@ -1041,7 +1041,7 @@ GetSessionVariable(Oid varid, bool *isNull, Oid *typid)
 }
 
 /*
- * Returns a copy of ths value of the session variable specified by its oid
+ * Returns a copy of the value of the session variable specified by its oid
  * with a check of the expected type. Like previous GetSessionVariable, the
  * caller is responsible for doing permission checks.
  */
diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c
index 212ddcb5da7..9860cf3f4d2 100644
--- a/src/backend/optimizer/plan/setrefs.c
+++ b/src/backend/optimizer/plan/setrefs.c
@@ -2099,7 +2099,7 @@ fix_expr_common(PlannerInfo *root, Node *node)
  * Just for paranoia's sake, we make a copy of the node in either case.
  *
  * If it's a PARAM_VARIABLE, then we collect used session variables in
- * list root->glob->sessionVariable. We should to assign Param paramvarid
+ * list root->glob->sessionVariable. We should assign Param paramvarid
  * too, and it is position of related session variable in mentioned list.
  */
 static Node *
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index 28523715765..c3edb30b79e 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -938,15 +938,15 @@ transformColumnRef(ParseState *pstate, ColumnRef *cref)
 
 		/*
 		 * Session variables are shadowed by columns, routine's variables or
-		 * routine's arguments ever. We don't want to use session variable
-		 * when it is not exactly shadowed, but RTE is valid like:
+		 * routine's arguments. We don't want to use session variable
+		 * when it is not exactly shadowed, but RTE like this is valid:
 		 *
 		 * CREATE TYPE T AS (c int); CREATE VARIABLE foo AS T; CREATE TABLE
 		 * foo(a int, b int);
 		 *
 		 * SELECT foo.a, foo.b, foo.c FROM foo;
 		 *
-		 * This case can be messy and then we disallow it. When we know, so
+		 * This case can be messy and then we disallow it. When we know that a
 		 * possible variable will be shadowed, we try to identify variable
 		 * only when session_variables_ambiguity_warning is requested.
 		 */