diff options
author | Alexander Korotkov <akorotkov@postgresql.org> | 2024-04-15 15:41:37 +0300 |
---|---|---|
committer | Alexander Korotkov <akorotkov@postgresql.org> | 2024-04-15 16:00:02 +0300 |
commit | 9dfcac8e15acc3b4d4d5bc02383a56ccb07229fe (patch) | |
tree | a2fb6cbc2b6c1c8ef895d1358a0789ac0bd4dab7 /src/backend/commands/tablecmds.c | |
parent | c3709100be73ad5af7ff536476d4d713bca41b1a (diff) | |
download | postgresql-9dfcac8e15acc3b4d4d5bc02383a56ccb07229fe.tar.gz postgresql-9dfcac8e15acc3b4d4d5bc02383a56ccb07229fe.zip |
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
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r-- | src/backend/commands/tablecmds.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index c33a5a5888a..78b0829ffc4 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -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); |