MCPcopy Create free account
hub / github.com/apache/cloudberry / ChoosePartitionName

Function ChoosePartitionName

src/backend/parser/parse_partition_gp.c:866–885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

864}
865
866char *
867ChoosePartitionName(const char *parentname, int level, Oid naemspaceId,
868 const char *partname, int partnum)
869{
870 char partsubstring[NAMEDATALEN];
871 char levelstr[NAMEDATALEN];
872
873 snprintf(levelstr, NAMEDATALEN, "%d", level);
874
875 if (partname)
876 {
877 snprintf(partsubstring, NAMEDATALEN, "prt_%s", partname);
878 return makeObjectName(parentname, levelstr, partsubstring);
879 }
880
881 Assert(partnum > 0);
882 snprintf(partsubstring, NAMEDATALEN, "prt_%d", partnum);
883 return ChooseRelationName(parentname, levelstr, partsubstring, naemspaceId,
884 false);
885}
886
887/*
888 * Construct a CreateStmt representing a single partition to be created as part

Callers 2

ATExecGPPartCmdsFunction · 0.85
makePartitionCreateStmtFunction · 0.85

Calls 2

makeObjectNameFunction · 0.85
ChooseRelationNameFunction · 0.85

Tested by

no test coverage detected