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

Function untransformRelOptions

src/backend/access/common/reloptions.c:1360–1395  ·  view source on GitHub ↗

* Convert the text-array format of reloptions into a List of DefElem. * This is the inverse of transformRelOptions(). */

Source from the content-addressed store, hash-verified

1358 * This is the inverse of transformRelOptions().
1359 */
1360List *
1361untransformRelOptions(Datum options)
1362{
1363 List *result = NIL;
1364 ArrayType *array;
1365 Datum *optiondatums;
1366 int noptions;
1367 int i;
1368
1369 /* Nothing to do if no options */
1370 if (!PointerIsValid(DatumGetPointer(options)))
1371 return result;
1372
1373 array = DatumGetArrayTypeP(options);
1374
1375 deconstruct_array(array, TEXTOID, -1, false, TYPALIGN_INT,
1376 &optiondatums, NULL, &noptions);
1377
1378 for (i = 0; i < noptions; i++)
1379 {
1380 char *s;
1381 char *p;
1382 Node *val = NULL;
1383
1384 s = TextDatumGetCString(optiondatums[i]);
1385 p = strchr(s, '=');
1386 if (p)
1387 {
1388 *p++ = '\0';
1389 val = (Node *) makeString(pstrdup(p));
1390 }
1391 result = lappend(result, makeDefElem(pstrdup(s), val, -1));
1392 }
1393
1394 return result;
1395}
1396
1397/*
1398 * Extract and parse reloptions from a pg_class tuple.

Callers 15

postgres_fdw_validatorFunction · 0.85
file_fdw_validatorFunction · 0.85
dblink_fdw_validatorFunction · 0.85
GetStorageServerExtendedFunction · 0.85
GetStorageUserMappingFunction · 0.85
AtExecGPSplitPartitionFunction · 0.85
transformGenericOptionsFunction · 0.85
ATExecSetRelOptionsFunction · 0.85
ATExecExpandTableCTASFunction · 0.85
ATExecSetDistributedByFunction · 0.85
generateClonedIndexStmtFunction · 0.85

Calls 5

deconstruct_arrayFunction · 0.85
makeStringFunction · 0.85
lappendFunction · 0.85
makeDefElemFunction · 0.85
pstrdupFunction · 0.50

Tested by

no test coverage detected