Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7c4ccb0

Browse files
jianhe-funCommitfest Bot
authored and
Commitfest Bot
committed
rename ExecComputeStoredGenerated to ExecComputeGenerated
to support virtual generated column over domain type, we actually need compute the virtual generated expression. we did it at ExecComputeGenerated for stored, we can use it for virtual. so do the rename. discussion: https://postgr.es/m/CACJufxFNUHxuSE=g20C2aLO3d+4T_j9h0x8esMirzcC4FrLbBg@mail.gmail.com
1 parent b006bcd commit 7c4ccb0

File tree

4 files changed

+18
-19
lines changed

4 files changed

+18
-19
lines changed

src/backend/commands/copyfrom.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,8 @@ CopyFrom(CopyFromState cstate)
13461346
/* Compute stored generated columns */
13471347
if (resultRelInfo->ri_RelationDesc->rd_att->constr &&
13481348
resultRelInfo->ri_RelationDesc->rd_att->constr->has_generated_stored)
1349-
ExecComputeStoredGenerated(resultRelInfo, estate, myslot,
1350-
CMD_INSERT);
1349+
ExecComputeGenerated(resultRelInfo, estate, myslot,
1350+
CMD_INSERT);
13511351

13521352
/*
13531353
* If the target is a plain table, check the constraints of

src/backend/executor/execReplication.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,8 @@ ExecSimpleRelationInsert(ResultRelInfo *resultRelInfo,
587587
/* Compute stored generated columns */
588588
if (rel->rd_att->constr &&
589589
rel->rd_att->constr->has_generated_stored)
590-
ExecComputeStoredGenerated(resultRelInfo, estate, slot,
591-
CMD_INSERT);
590+
ExecComputeGenerated(resultRelInfo, estate, slot,
591+
CMD_INSERT);
592592

593593
/* Check the constraints of the tuple */
594594
if (rel->rd_att->constr)
@@ -684,8 +684,8 @@ ExecSimpleRelationUpdate(ResultRelInfo *resultRelInfo,
684684
/* Compute stored generated columns */
685685
if (rel->rd_att->constr &&
686686
rel->rd_att->constr->has_generated_stored)
687-
ExecComputeStoredGenerated(resultRelInfo, estate, slot,
688-
CMD_UPDATE);
687+
ExecComputeGenerated(resultRelInfo, estate, slot,
688+
CMD_UPDATE);
689689

690690
/* Check the constraints of the tuple */
691691
if (rel->rd_att->constr)

src/backend/executor/nodeModifyTable.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -538,12 +538,12 @@ ExecInitGenerated(ResultRelInfo *resultRelInfo,
538538
}
539539

540540
/*
541-
* Compute stored generated columns for a tuple
541+
* Compute generated columns for a tuple.
542+
* we might support virtual generated column in future, currently not.
542543
*/
543544
void
544-
ExecComputeStoredGenerated(ResultRelInfo *resultRelInfo,
545-
EState *estate, TupleTableSlot *slot,
546-
CmdType cmdtype)
545+
ExecComputeGenerated(ResultRelInfo *resultRelInfo, EState *estate,
546+
TupleTableSlot *slot, CmdType cmdtype)
547547
{
548548
Relation rel = resultRelInfo->ri_RelationDesc;
549549
TupleDesc tupdesc = RelationGetDescr(rel);
@@ -932,8 +932,8 @@ ExecInsert(ModifyTableContext *context,
932932
*/
933933
if (resultRelationDesc->rd_att->constr &&
934934
resultRelationDesc->rd_att->constr->has_generated_stored)
935-
ExecComputeStoredGenerated(resultRelInfo, estate, slot,
936-
CMD_INSERT);
935+
ExecComputeGenerated(resultRelInfo, estate, slot,
936+
CMD_INSERT);
937937

938938
/*
939939
* If the FDW supports batching, and batching is requested, accumulate
@@ -1059,8 +1059,8 @@ ExecInsert(ModifyTableContext *context,
10591059
*/
10601060
if (resultRelationDesc->rd_att->constr &&
10611061
resultRelationDesc->rd_att->constr->has_generated_stored)
1062-
ExecComputeStoredGenerated(resultRelInfo, estate, slot,
1063-
CMD_INSERT);
1062+
ExecComputeGenerated(resultRelInfo, estate, slot,
1063+
CMD_INSERT);
10641064

10651065
/*
10661066
* Check any RLS WITH CHECK policies.
@@ -2147,8 +2147,8 @@ ExecUpdatePrepareSlot(ResultRelInfo *resultRelInfo,
21472147
*/
21482148
if (resultRelationDesc->rd_att->constr &&
21492149
resultRelationDesc->rd_att->constr->has_generated_stored)
2150-
ExecComputeStoredGenerated(resultRelInfo, estate, slot,
2151-
CMD_UPDATE);
2150+
ExecComputeGenerated(resultRelInfo, estate, slot,
2151+
CMD_UPDATE);
21522152
}
21532153

21542154
/*

src/include/executor/nodeModifyTable.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ extern void ExecInitGenerated(ResultRelInfo *resultRelInfo,
1919
EState *estate,
2020
CmdType cmdtype);
2121

22-
extern void ExecComputeStoredGenerated(ResultRelInfo *resultRelInfo,
23-
EState *estate, TupleTableSlot *slot,
24-
CmdType cmdtype);
22+
extern void ExecComputeGenerated(ResultRelInfo *resultRelInfo, EState *estate,
23+
TupleTableSlot *slot,CmdType cmdtype);
2524

2625
extern ModifyTableState *ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags);
2726
extern void ExecEndModifyTable(ModifyTableState *node);

0 commit comments

Comments
 (0)