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

Function NameListToString

src/backend/catalog/namespace.c:3212–3237  ·  view source on GitHub ↗

* NameListToString * Utility routine to convert a qualified-name list into a string. * * This is used primarily to form error messages, and so we do not quote * the list elements, for the sake of legibility. * * In most scenarios the list elements should always be Value strings, * but we also allow A_Star for the convenience of ColumnRef processing. */

Source from the content-addressed store, hash-verified

3210 * but we also allow A_Star for the convenience of ColumnRef processing.
3211 */
3212char *
3213NameListToString(List *names)
3214{
3215 StringInfoData string;
3216 ListCell *l;
3217
3218 initStringInfo(&string);
3219
3220 foreach(l, names)
3221 {
3222 Node *name = (Node *) lfirst(l);
3223
3224 if (l != list_head(names))
3225 appendStringInfoChar(&string, '.');
3226
3227 if (IsA(name, String))
3228 appendStringInfoString(&string, strVal(name));
3229 else if (IsA(name, A_Star))
3230 appendStringInfoChar(&string, '*');
3231 else
3232 elog(ERROR, "unexpected node type in name list: %d",
3233 (int) nodeTag(name));
3234 }
3235
3236 return string.data;
3237}
3238
3239/*
3240 * NameListToQuotedString

Callers 15

plpgsql_post_column_refFunction · 0.85
defGetStringFunction · 0.85
ResolveOpClassFunction · 0.85
CreateConversionCommandFunction · 0.85
CreateTriggerFiringOnFunction · 0.85
DefineTypeFunction · 0.85
findTypeInputFunctionFunction · 0.85
findTypeOutputFunctionFunction · 0.85
findTypeReceiveFunctionFunction · 0.85
findTypeSendFunctionFunction · 0.85
findTypeTypmodinFunctionFunction · 0.85

Calls 5

initStringInfoFunction · 0.85
list_headFunction · 0.85
appendStringInfoCharFunction · 0.85
appendStringInfoStringFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected