Skip to content

Commit df64c81

Browse files
committed
Fix some grammer errors from error messages and codes comments
Discussion: https://postgr.es/m/CAHewXNkGMPU50QG7V6Q60JGFORfo8LfYO1_GCkCa0VWbmB-fEw%40mail.gmail.com Author: Tender Wang
1 parent 4220415 commit df64c81

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

src/backend/commands/tablecmds.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19099,7 +19099,7 @@ QueuePartitionConstraintValidation(List **wqueue, Relation scanrel,
1909919099
}
1910019100

1910119101
/*
19102-
* attachPartitionTable: attach new partition to partitioned table
19102+
* attachPartitionTable: attach a new partition to the partitioned table
1910319103
*
1910419104
* wqueue: the ALTER TABLE work queue; can be NULL when not running as part
1910519105
* of an ALTER TABLE sequence.
@@ -20892,10 +20892,10 @@ GetAttributeStorage(Oid atttypid, const char *storagemode)
2089220892
*/
2089320893
typedef struct SplitPartitionContext
2089420894
{
20895-
ExprState *partqualstate; /* expression for check slot for partition
20895+
ExprState *partqualstate; /* expression for checking slot for partition
2089620896
* (NULL for DEFAULT partition) */
2089720897
BulkInsertState bistate; /* state of bulk inserts for partition */
20898-
TupleTableSlot *dstslot; /* slot for insert row into partition */
20898+
TupleTableSlot *dstslot; /* slot for inserting row into partition */
2089920899
Relation partRel; /* relation for partition */
2090020900
} SplitPartitionContext;
2090120901

@@ -21142,7 +21142,7 @@ moveSplitTableRows(Relation rel, Relation splitRel, List *partlist, List *newPar
2114221142
}
2114321143

2114421144
/*
21145-
* createPartitionTable: create table for new partition with given name
21145+
* createPartitionTable: create table for a new partition with given name
2114621146
* (newPartName) like table (modelRelName)
2114721147
*
2114821148
* Emulates command: CREATE TABLE <newPartName> (LIKE <modelRelName>
@@ -21219,7 +21219,7 @@ ATExecSplitPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
2121921219

2122021220
/*
2122121221
* We are going to detach and remove this partition: need to use exclusive
21222-
* lock for prevent DML-queries to the partition.
21222+
* lock for preventing DML-queries to the partition.
2122321223
*/
2122421224
splitRel = table_openrv(cmd->name, AccessExclusiveLock);
2122521225

@@ -21269,13 +21269,13 @@ ATExecSplitPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
2126921269

2127021270
/*
2127121271
* If new partition has the same name as split partition then we should
21272-
* rename split partition for reuse name.
21272+
* rename split partition for reusing name.
2127321273
*/
2127421274
if (isSameName)
2127521275
{
2127621276
/*
2127721277
* We must bump the command counter to make the split partition tuple
21278-
* visible for rename.
21278+
* visible for renaming.
2127921279
*/
2128021280
CommandCounterIncrement();
2128121281
/* Rename partition. */
@@ -21284,7 +21284,7 @@ ATExecSplitPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
2128421284

2128521285
/*
2128621286
* We must bump the command counter to make the split partition tuple
21287-
* visible after rename.
21287+
* visible after renaming.
2128821288
*/
2128921289
CommandCounterIncrement();
2129021290
}
@@ -21459,7 +21459,7 @@ ATExecMergePartitions(List **wqueue, AlteredTableInfo *tab, Relation rel,
2145921459

2146021460
/*
2146121461
* We are going to detach and remove this partition: need to use
21462-
* exclusive lock for prevent DML-queries to the partition.
21462+
* exclusive lock for preventing DML-queries to the partition.
2146321463
*/
2146421464
mergingPartition = table_openrv(name, AccessExclusiveLock);
2146521465

src/backend/parser/parse_utilcmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3804,7 +3804,7 @@ transformAlterTableStmt(Oid relid, AlterTableStmt *stmt,
38043804
if (list_length(partcmd->partlist) < 2)
38053805
ereport(ERROR,
38063806
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
3807-
errmsg("list of new partitions should contains at least two items")));
3807+
errmsg("list of new partitions should contain at least two items")));
38083808

38093809
if (cmd->subtype == AT_SplitPartition)
38103810
transformPartitionCmdForSplit(&cxt, partcmd);

src/backend/partitioning/partbounds.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4986,7 +4986,7 @@ satisfies_hash_partition(PG_FUNCTION_ARGS)
49864986
* This is a helper function for check_partitions_for_split() and
49874987
* calculate_partition_bound_for_merge().
49884988
* This function compares upper bound of first_bound and lower bound of
4989-
* second_bound. These bounds should be equals except case
4989+
* second_bound. These bounds should be equal except case
49904990
* "defaultPart == true" (this means that one of split partitions is DEFAULT).
49914991
* In this case upper bound of first_bound can be less than lower bound of
49924992
* second_bound because space between of these bounds will be included in
@@ -5262,7 +5262,7 @@ check_partition_bounds_for_split_range(Relation parent,
52625262
errmsg("%s bound of partition \"%s\" is %s %s bound of split partition",
52635263
first ? "lower" : "upper",
52645264
relname,
5265-
defaultPart ? (first ? "less than" : "greater than") : "not equals to",
5265+
defaultPart ? (first ? "less than" : "greater than") : "not equal to",
52665266
first ? "lower" : "upper"),
52675267
parser_errposition(pstate, datum->location)));
52685268
}
@@ -5483,7 +5483,11 @@ check_parent_values_in_new_partitions(Relation parent,
54835483
Const *notFoundVal;
54845484

54855485
if (!searchNull)
5486-
/* Make Const for get string representation of not found value. */
5486+
5487+
/*
5488+
* Make Const for getting string representation of not found
5489+
* value.
5490+
*/
54875491
notFoundVal = makeConst(key->parttypid[0],
54885492
key->parttypmod[0],
54895493
key->parttypcoll[0],

src/include/nodes/parsenodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -956,8 +956,8 @@ typedef struct PartitionCmd
956956
NodeTag type;
957957
RangeVar *name; /* name of partition to attach/detach */
958958
PartitionBoundSpec *bound; /* FOR VALUES, if attaching */
959-
List *partlist; /* list of partitions, for SPLIT PARTITION
960-
* command */
959+
List *partlist; /* list of partitions, for MERGE/SPLIT
960+
* PARTITION command */
961961
bool concurrent;
962962
} PartitionCmd;
963963

src/test/regress/expected/partition_split.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ DETAIL: Specified lower bound ('03-01-2022') is greater than or equal to upper
4646
--ERROR: list of split partitions should contains at least two items
4747
ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO
4848
(PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-01') TO ('2022-10-01'));
49-
ERROR: list of new partitions should contains at least two items
49+
ERROR: list of new partitions should contain at least two items
5050
-- ERROR: lower bound of partition "sales_feb2022" is less than lower bound of split partition
5151
ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO
5252
(PARTITION sales_feb2022 FOR VALUES FROM ('2022-01-01') TO ('2022-03-01'),
@@ -101,7 +101,7 @@ ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO
101101
(PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-02') TO ('2022-03-01'),
102102
PARTITION sales_mar2022 FOR VALUES FROM ('2022-03-01') TO ('2022-04-01'),
103103
PARTITION sales_apr2022 FOR VALUES FROM ('2022-04-01') TO ('2022-05-01'));
104-
ERROR: lower bound of partition "sales_feb2022" is not equals to lower bound of split partition
104+
ERROR: lower bound of partition "sales_feb2022" is not equal to lower bound of split partition
105105
LINE 2: (PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-02') TO...
106106
^
107107
DROP TABLE sales_range;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy