mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
Reindent table partitioning code.
We've accumulated quite a bit of stuff with which pgindent is not quite happy in this code; clean it up to provide a less-annoying base for future pgindent runs.
This commit is contained in:
@ -1780,12 +1780,12 @@ heap_drop_with_catalog(Oid relid)
|
||||
|
||||
/*
|
||||
* If the relation is a partition, we must grab exclusive lock on its
|
||||
* parent because we need to update its partition descriptor. We must
|
||||
* take a table lock strong enough to prevent all queries on the parent
|
||||
* from proceeding until we commit and send out a shared-cache-inval
|
||||
* notice that will make them update their partition descriptor.
|
||||
* Sometimes, doing this is cycles spent uselessly, especially if the
|
||||
* parent will be dropped as part of the same command anyway.
|
||||
* parent because we need to update its partition descriptor. We must take
|
||||
* a table lock strong enough to prevent all queries on the parent from
|
||||
* proceeding until we commit and send out a shared-cache-inval notice
|
||||
* that will make them update their partition descriptor. Sometimes, doing
|
||||
* this is cycles spent uselessly, especially if the parent will be
|
||||
* dropped as part of the same command anyway.
|
||||
*/
|
||||
if (rel->rd_rel->relispartition)
|
||||
{
|
||||
@ -3185,8 +3185,8 @@ StorePartitionKey(Relation rel,
|
||||
|
||||
/*
|
||||
* Anything mentioned in the expressions. We must ignore the column
|
||||
* references, which will depend on the table itself; there is no
|
||||
* separate partition key object.
|
||||
* references, which will depend on the table itself; there is no separate
|
||||
* partition key object.
|
||||
*/
|
||||
if (partexprs)
|
||||
recordDependencyOnSingleRelExpr(&myself,
|
||||
|
@ -1082,11 +1082,11 @@ RelationGetPartitionDispatchInfo(Relation rel, int lockmode,
|
||||
if (parent != NULL)
|
||||
{
|
||||
/*
|
||||
* For every partitioned table other than root, we must store
|
||||
* a tuple table slot initialized with its tuple descriptor and
|
||||
* a tuple conversion map to convert a tuple from its parent's
|
||||
* rowtype to its own. That is to make sure that we are looking
|
||||
* at the correct row using the correct tuple descriptor when
|
||||
* For every partitioned table other than root, we must store a
|
||||
* tuple table slot initialized with its tuple descriptor and a
|
||||
* tuple conversion map to convert a tuple from its parent's
|
||||
* rowtype to its own. That is to make sure that we are looking at
|
||||
* the correct row using the correct tuple descriptor when
|
||||
* computing its partition key for tuple routing.
|
||||
*/
|
||||
pd[i]->tupslot = MakeSingleTupleTableSlot(tupdesc);
|
||||
@ -1574,10 +1574,10 @@ generate_partition_qual(Relation rel)
|
||||
result = my_qual;
|
||||
|
||||
/*
|
||||
* Change Vars to have partition's attnos instead of the parent's.
|
||||
* We do this after we concatenate the parent's quals, because
|
||||
* we want every Var in it to bear this relation's attnos.
|
||||
* It's safe to assume varno = 1 here.
|
||||
* Change Vars to have partition's attnos instead of the parent's. We do
|
||||
* this after we concatenate the parent's quals, because we want every Var
|
||||
* in it to bear this relation's attnos. It's safe to assume varno = 1
|
||||
* here.
|
||||
*/
|
||||
result = map_partition_varattnos(result, 1, rel, parent);
|
||||
|
||||
|
@ -164,8 +164,7 @@ typedef struct CopyStateData
|
||||
|
||||
PartitionDispatch *partition_dispatch_info;
|
||||
int num_dispatch; /* Number of entries in the above array */
|
||||
int num_partitions; /* Number of members in the following
|
||||
* arrays */
|
||||
int num_partitions; /* Number of members in the following arrays */
|
||||
ResultRelInfo *partitions; /* Per partition result relation */
|
||||
TupleConversionMap **partition_tupconv_maps;
|
||||
TupleTableSlot *partition_tuple_slot;
|
||||
|
@ -285,10 +285,10 @@ ExecInsert(ModifyTableState *mtstate,
|
||||
/*
|
||||
* Away we go ... If we end up not finding a partition after all,
|
||||
* ExecFindPartition() does not return and errors out instead.
|
||||
* Otherwise, the returned value is to be used as an index into
|
||||
* arrays mt_partitions[] and mt_partition_tupconv_maps[] that
|
||||
* will get us the ResultRelInfo and TupleConversionMap for the
|
||||
* partition, respectively.
|
||||
* Otherwise, the returned value is to be used as an index into arrays
|
||||
* mt_partitions[] and mt_partition_tupconv_maps[] that will get us
|
||||
* the ResultRelInfo and TupleConversionMap for the partition,
|
||||
* respectively.
|
||||
*/
|
||||
leaf_part_index = ExecFindPartition(resultRelInfo,
|
||||
mtstate->mt_partition_dispatch_info,
|
||||
@ -325,9 +325,9 @@ ExecInsert(ModifyTableState *mtstate,
|
||||
tuple = do_convert_tuple(tuple, map);
|
||||
|
||||
/*
|
||||
* We must use the partition's tuple descriptor from this
|
||||
* point on, until we're finished dealing with the partition.
|
||||
* Use the dedicated slot for that.
|
||||
* We must use the partition's tuple descriptor from this point
|
||||
* on, until we're finished dealing with the partition. Use the
|
||||
* dedicated slot for that.
|
||||
*/
|
||||
slot = mtstate->mt_partition_tuple_slot;
|
||||
Assert(slot != NULL);
|
||||
@ -1821,9 +1821,9 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
|
||||
/*
|
||||
* Build a projection for each leaf partition rel. Note that we
|
||||
* didn't build the returningList for each partition within the
|
||||
* planner, but simple translation of the varattnos for each
|
||||
* partition will suffice. This only occurs for the INSERT case;
|
||||
* UPDATE/DELETE are handled above.
|
||||
* planner, but simple translation of the varattnos for each partition
|
||||
* will suffice. This only occurs for the INSERT case; UPDATE/DELETE
|
||||
* are handled above.
|
||||
*/
|
||||
resultRelInfo = mtstate->mt_partitions;
|
||||
returningList = linitial(node->returningLists);
|
||||
@ -2095,7 +2095,8 @@ ExecEndModifyTable(ModifyTableState *node)
|
||||
resultRelInfo);
|
||||
}
|
||||
|
||||
/* Close all the partitioned tables, leaf partitions, and their indices
|
||||
/*
|
||||
* Close all the partitioned tables, leaf partitions, and their indices
|
||||
*
|
||||
* Remember node->mt_partition_dispatch_info[0] corresponds to the root
|
||||
* partitioned table, which we must not try to close, because it is the
|
||||
|
@ -1476,8 +1476,8 @@ pg_get_partkeydef_worker(Oid relid, int prettyFlags)
|
||||
|
||||
/*
|
||||
* Get the expressions, if any. (NOTE: we do not use the relcache
|
||||
* versions of the expressions, because we want to display non-const-folded
|
||||
* expressions.)
|
||||
* versions of the expressions, because we want to display
|
||||
* non-const-folded expressions.)
|
||||
*/
|
||||
if (!heap_attisnull(tuple, Anum_pg_partitioned_table_partexprs))
|
||||
{
|
||||
|
@ -749,8 +749,8 @@ typedef struct PartitionBoundSpec
|
||||
List *listdatums;
|
||||
|
||||
/*
|
||||
* Range partition lower and upper bounds; each member of the lists
|
||||
* is a PartitionRangeDatum (see below).
|
||||
* Range partition lower and upper bounds; each member of the lists is a
|
||||
* PartitionRangeDatum (see below).
|
||||
*/
|
||||
List *lowerdatums;
|
||||
List *upperdatums;
|
||||
|
Reference in New Issue
Block a user