mirror of
https://github.com/postgres/postgres.git
synced 2025-05-31 00:01:57 -04:00
Fix some grammer errors from error messages and codes comments
Discussion: https://postgr.es/m/CAHewXNkGMPU50QG7V6Q60JGFORfo8LfYO1_GCkCa0VWbmB-fEw%40mail.gmail.com Author: Tender Wang
This commit is contained in:
parent
422041542f
commit
df64c81ca9
@ -19099,7 +19099,7 @@ QueuePartitionConstraintValidation(List **wqueue, Relation scanrel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* attachPartitionTable: attach new partition to partitioned table
|
* attachPartitionTable: attach a new partition to the partitioned table
|
||||||
*
|
*
|
||||||
* wqueue: the ALTER TABLE work queue; can be NULL when not running as part
|
* wqueue: the ALTER TABLE work queue; can be NULL when not running as part
|
||||||
* of an ALTER TABLE sequence.
|
* of an ALTER TABLE sequence.
|
||||||
@ -20892,10 +20892,10 @@ GetAttributeStorage(Oid atttypid, const char *storagemode)
|
|||||||
*/
|
*/
|
||||||
typedef struct SplitPartitionContext
|
typedef struct SplitPartitionContext
|
||||||
{
|
{
|
||||||
ExprState *partqualstate; /* expression for check slot for partition
|
ExprState *partqualstate; /* expression for checking slot for partition
|
||||||
* (NULL for DEFAULT partition) */
|
* (NULL for DEFAULT partition) */
|
||||||
BulkInsertState bistate; /* state of bulk inserts for partition */
|
BulkInsertState bistate; /* state of bulk inserts for partition */
|
||||||
TupleTableSlot *dstslot; /* slot for insert row into partition */
|
TupleTableSlot *dstslot; /* slot for inserting row into partition */
|
||||||
Relation partRel; /* relation for partition */
|
Relation partRel; /* relation for partition */
|
||||||
} SplitPartitionContext;
|
} SplitPartitionContext;
|
||||||
|
|
||||||
@ -21142,7 +21142,7 @@ moveSplitTableRows(Relation rel, Relation splitRel, List *partlist, List *newPar
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* createPartitionTable: create table for new partition with given name
|
* createPartitionTable: create table for a new partition with given name
|
||||||
* (newPartName) like table (modelRelName)
|
* (newPartName) like table (modelRelName)
|
||||||
*
|
*
|
||||||
* Emulates command: CREATE TABLE <newPartName> (LIKE <modelRelName>
|
* Emulates command: CREATE TABLE <newPartName> (LIKE <modelRelName>
|
||||||
@ -21219,7 +21219,7 @@ ATExecSplitPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* We are going to detach and remove this partition: need to use exclusive
|
* We are going to detach and remove this partition: need to use exclusive
|
||||||
* lock for prevent DML-queries to the partition.
|
* lock for preventing DML-queries to the partition.
|
||||||
*/
|
*/
|
||||||
splitRel = table_openrv(cmd->name, AccessExclusiveLock);
|
splitRel = table_openrv(cmd->name, AccessExclusiveLock);
|
||||||
|
|
||||||
@ -21269,13 +21269,13 @@ ATExecSplitPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* If new partition has the same name as split partition then we should
|
* If new partition has the same name as split partition then we should
|
||||||
* rename split partition for reuse name.
|
* rename split partition for reusing name.
|
||||||
*/
|
*/
|
||||||
if (isSameName)
|
if (isSameName)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* We must bump the command counter to make the split partition tuple
|
* We must bump the command counter to make the split partition tuple
|
||||||
* visible for rename.
|
* visible for renaming.
|
||||||
*/
|
*/
|
||||||
CommandCounterIncrement();
|
CommandCounterIncrement();
|
||||||
/* Rename partition. */
|
/* Rename partition. */
|
||||||
@ -21284,7 +21284,7 @@ ATExecSplitPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* We must bump the command counter to make the split partition tuple
|
* We must bump the command counter to make the split partition tuple
|
||||||
* visible after rename.
|
* visible after renaming.
|
||||||
*/
|
*/
|
||||||
CommandCounterIncrement();
|
CommandCounterIncrement();
|
||||||
}
|
}
|
||||||
@ -21459,7 +21459,7 @@ ATExecMergePartitions(List **wqueue, AlteredTableInfo *tab, Relation rel,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* We are going to detach and remove this partition: need to use
|
* We are going to detach and remove this partition: need to use
|
||||||
* exclusive lock for prevent DML-queries to the partition.
|
* exclusive lock for preventing DML-queries to the partition.
|
||||||
*/
|
*/
|
||||||
mergingPartition = table_openrv(name, AccessExclusiveLock);
|
mergingPartition = table_openrv(name, AccessExclusiveLock);
|
||||||
|
|
||||||
|
@ -3804,7 +3804,7 @@ transformAlterTableStmt(Oid relid, AlterTableStmt *stmt,
|
|||||||
if (list_length(partcmd->partlist) < 2)
|
if (list_length(partcmd->partlist) < 2)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||||
errmsg("list of new partitions should contains at least two items")));
|
errmsg("list of new partitions should contain at least two items")));
|
||||||
|
|
||||||
if (cmd->subtype == AT_SplitPartition)
|
if (cmd->subtype == AT_SplitPartition)
|
||||||
transformPartitionCmdForSplit(&cxt, partcmd);
|
transformPartitionCmdForSplit(&cxt, partcmd);
|
||||||
|
@ -4986,7 +4986,7 @@ satisfies_hash_partition(PG_FUNCTION_ARGS)
|
|||||||
* This is a helper function for check_partitions_for_split() and
|
* This is a helper function for check_partitions_for_split() and
|
||||||
* calculate_partition_bound_for_merge().
|
* calculate_partition_bound_for_merge().
|
||||||
* This function compares upper bound of first_bound and lower bound of
|
* This function compares upper bound of first_bound and lower bound of
|
||||||
* second_bound. These bounds should be equals except case
|
* second_bound. These bounds should be equal except case
|
||||||
* "defaultPart == true" (this means that one of split partitions is DEFAULT).
|
* "defaultPart == true" (this means that one of split partitions is DEFAULT).
|
||||||
* In this case upper bound of first_bound can be less than lower bound of
|
* In this case upper bound of first_bound can be less than lower bound of
|
||||||
* second_bound because space between of these bounds will be included in
|
* second_bound because space between of these bounds will be included in
|
||||||
@ -5262,7 +5262,7 @@ check_partition_bounds_for_split_range(Relation parent,
|
|||||||
errmsg("%s bound of partition \"%s\" is %s %s bound of split partition",
|
errmsg("%s bound of partition \"%s\" is %s %s bound of split partition",
|
||||||
first ? "lower" : "upper",
|
first ? "lower" : "upper",
|
||||||
relname,
|
relname,
|
||||||
defaultPart ? (first ? "less than" : "greater than") : "not equals to",
|
defaultPart ? (first ? "less than" : "greater than") : "not equal to",
|
||||||
first ? "lower" : "upper"),
|
first ? "lower" : "upper"),
|
||||||
parser_errposition(pstate, datum->location)));
|
parser_errposition(pstate, datum->location)));
|
||||||
}
|
}
|
||||||
@ -5483,7 +5483,11 @@ check_parent_values_in_new_partitions(Relation parent,
|
|||||||
Const *notFoundVal;
|
Const *notFoundVal;
|
||||||
|
|
||||||
if (!searchNull)
|
if (!searchNull)
|
||||||
/* Make Const for get string representation of not found value. */
|
|
||||||
|
/*
|
||||||
|
* Make Const for getting string representation of not found
|
||||||
|
* value.
|
||||||
|
*/
|
||||||
notFoundVal = makeConst(key->parttypid[0],
|
notFoundVal = makeConst(key->parttypid[0],
|
||||||
key->parttypmod[0],
|
key->parttypmod[0],
|
||||||
key->parttypcoll[0],
|
key->parttypcoll[0],
|
||||||
|
@ -956,8 +956,8 @@ typedef struct PartitionCmd
|
|||||||
NodeTag type;
|
NodeTag type;
|
||||||
RangeVar *name; /* name of partition to attach/detach */
|
RangeVar *name; /* name of partition to attach/detach */
|
||||||
PartitionBoundSpec *bound; /* FOR VALUES, if attaching */
|
PartitionBoundSpec *bound; /* FOR VALUES, if attaching */
|
||||||
List *partlist; /* list of partitions, for SPLIT PARTITION
|
List *partlist; /* list of partitions, for MERGE/SPLIT
|
||||||
* command */
|
* PARTITION command */
|
||||||
bool concurrent;
|
bool concurrent;
|
||||||
} PartitionCmd;
|
} PartitionCmd;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ DETAIL: Specified lower bound ('03-01-2022') is greater than or equal to upper
|
|||||||
--ERROR: list of split partitions should contains at least two items
|
--ERROR: list of split partitions should contains at least two items
|
||||||
ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO
|
ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO
|
||||||
(PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-01') TO ('2022-10-01'));
|
(PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-01') TO ('2022-10-01'));
|
||||||
ERROR: list of new partitions should contains at least two items
|
ERROR: list of new partitions should contain at least two items
|
||||||
-- ERROR: lower bound of partition "sales_feb2022" is less than lower bound of split partition
|
-- ERROR: lower bound of partition "sales_feb2022" is less than lower bound of split partition
|
||||||
ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO
|
ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO
|
||||||
(PARTITION sales_feb2022 FOR VALUES FROM ('2022-01-01') TO ('2022-03-01'),
|
(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
|
|||||||
(PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-02') TO ('2022-03-01'),
|
(PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-02') TO ('2022-03-01'),
|
||||||
PARTITION sales_mar2022 FOR VALUES FROM ('2022-03-01') TO ('2022-04-01'),
|
PARTITION sales_mar2022 FOR VALUES FROM ('2022-03-01') TO ('2022-04-01'),
|
||||||
PARTITION sales_apr2022 FOR VALUES FROM ('2022-04-01') TO ('2022-05-01'));
|
PARTITION sales_apr2022 FOR VALUES FROM ('2022-04-01') TO ('2022-05-01'));
|
||||||
ERROR: lower bound of partition "sales_feb2022" is not equals to lower bound of split partition
|
ERROR: lower bound of partition "sales_feb2022" is not equal to lower bound of split partition
|
||||||
LINE 2: (PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-02') TO...
|
LINE 2: (PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-02') TO...
|
||||||
^
|
^
|
||||||
DROP TABLE sales_range;
|
DROP TABLE sales_range;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user