1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Grammar fixes for split/merge partitions code

The fixes relate to comments, error messages, and corresponding expected output
of regression tests.

Discussion: https://postgr.es/m/CAMbWs49DDsknxyoycBqiE72VxzL_sYHF6zqL8dSeNehKPJhkKg%40mail.gmail.com
Discussion: https://postgr.es/m/86bfd241-a58c-479a-9a72-2c67a02becf8%40postgrespro.ru
Discussion: https://postgr.es/m/CAHewXNkGMPU50QG7V6Q60JGFORfo8LfYO1_GCkCa0VWbmB-fEw%40mail.gmail.com
Author: Richard Guo, Dmitry Koval, Tender Wang
This commit is contained in:
Alexander Korotkov
2024-04-15 15:41:37 +03:00
parent c3709100be
commit 9dfcac8e15
10 changed files with 104 additions and 100 deletions

View File

@ -20875,7 +20875,7 @@ GetAttributeStorage(Oid atttypid, const char *storagemode)
}
/*
* Struct with context of new partition for insert rows from splited partition
* Struct with context of new partition for inserting rows from split partition
*/
typedef struct SplitPartitionContext
{
@ -20932,7 +20932,7 @@ deleteSplitPartitionContext(SplitPartitionContext *pc, int ti_options)
*
* New partitions description:
* partlist: list of pointers to SinglePartitionSpec structures.
* newPartRels: list of Relation's.
* newPartRels: list of Relations.
* defaultPartOid: oid of DEFAULT partition, for table rel.
*/
static void
@ -21017,7 +21017,7 @@ moveSplitTableRows(Relation rel, Relation splitRel, List *partlist, List *newPar
/*
* Map computing for moving attributes of split partition to new partition
* (for first new partition but other new partitions can use the same
* (for first new partition, but other new partitions can use the same
* map).
*/
pc = (SplitPartitionContext *) lfirst(list_head(partContexts));
@ -21071,7 +21071,7 @@ moveSplitTableRows(Relation rel, Relation splitRel, List *partlist, List *newPar
if (tuple_map)
{
/* Need to use map for copy attributes. */
/* Need to use map to copy attributes. */
insertslot = execute_attr_map_slot(tuple_map->attrMap, srcslot, pc->dstslot);
}
else
@ -21226,8 +21226,8 @@ ATExecSplitPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
RangeVarGetAndCheckCreationNamespace(sps->name, NoLock, NULL);
/*
* This would fail later on anyway, if the relation already exists.
* But by catching it here we can emit a nicer error message.
* This would fail later on anyway if the relation already exists. But
* by catching it here we can emit a nicer error message.
*/
existing_relid = get_relname_relid(relname, namespaceId);
if (existing_relid == splitRelOid && !isSameName)
@ -21293,7 +21293,10 @@ ATExecSplitPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
SinglePartitionSpec *sps = (SinglePartitionSpec *) lfirst(listptr);
Relation newPartRel = (Relation) lfirst(listptr2);
/* wqueue = NULL: verification for each cloned constraint is not need. */
/*
* wqueue = NULL: verification for each cloned constraint is not
* needed.
*/
attachPartitionTable(NULL, rel, newPartRel, sps->bound);
/* Keep the lock until commit. */
table_close(newPartRel, NoLock);
@ -21366,7 +21369,7 @@ moveMergedTablesRows(Relation rel, List *mergingPartitionsList,
if (tuple_map)
{
/* Need to use map for copy attributes. */
/* Need to use map to copy attributes. */
insertslot = execute_attr_map_slot(tuple_map->attrMap, srcslot, dstslot);
}
else
@ -21465,7 +21468,7 @@ ATExecMergePartitions(List **wqueue, AlteredTableInfo *tab, Relation rel,
/* Create table for new partition, use partitioned table as model. */
if (isSameName)
{
/* Create partition table with generated temparary name. */
/* Create partition table with generated temporary name. */
sprintf(tmpRelName, "merge-%u-%X-tmp", RelationGetRelid(rel), MyProcPid);
mergePartName = makeRangeVar(get_namespace_name(RelationGetNamespace(rel)),
tmpRelName, -1);