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

Function ExtractConnectionOptions

contrib/postgres_fdw/option.c:371–394  ·  view source on GitHub ↗

* Generate key-value arrays which include only libpq options from the * given list (which can contain any kind of options). Caller must have * allocated large-enough arrays. Returns number of options found. */

Source from the content-addressed store, hash-verified

369 * allocated large-enough arrays. Returns number of options found.
370 */
371int
372ExtractConnectionOptions(List *defelems, const char **keywords,
373 const char **values)
374{
375 ListCell *lc;
376 int i;
377
378 /* Build our options lists if we didn't yet. */
379 InitPgFdwOptions();
380
381 i = 0;
382 foreach(lc, defelems)
383 {
384 DefElem *d = (DefElem *) lfirst(lc);
385
386 if (is_libpq_option(d->defname))
387 {
388 keywords[i] = d->defname;
389 values[i] = defGetString(d);
390 i++;
391 }
392 }
393 return i;
394}
395
396/*
397 * Parse a comma-separated string and return a List of the OIDs of the

Callers 1

connect_pg_serverFunction · 0.85

Calls 4

InitPgFdwOptionsFunction · 0.85
is_libpq_optionFunction · 0.85
defGetStringFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected