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

Function PQconndefaults

src/interfaces/libpq/fe-connect.c:1545–1569  ·  view source on GitHub ↗

* PQconndefaults * * Construct a default connection options array, which identifies all the * available options and shows any default values that are available from the * environment etc. On error (eg out of memory), NULL is returned. * * Using this function, an application may determine all possible options * and their current default values. * * NOTE: as of PostgreSQL 7.0, the returne

Source from the content-addressed store, hash-verified

1543 * until they are updated to call PQconninfoFree.
1544 */
1545PQconninfoOption *
1546PQconndefaults(void)
1547{
1548 PQExpBufferData errorBuf;
1549 PQconninfoOption *connOptions;
1550
1551 /* We don't actually report any errors here, but callees want a buffer */
1552 initPQExpBuffer(&errorBuf);
1553 if (PQExpBufferDataBroken(errorBuf))
1554 return NULL; /* out of memory already :-( */
1555
1556 connOptions = conninfo_init(&errorBuf);
1557 if (connOptions != NULL)
1558 {
1559 /* pass NULL errorBuf to ignore errors */
1560 if (!conninfo_add_defaults(connOptions, NULL))
1561 {
1562 PQconninfoFree(connOptions);
1563 connOptions = NULL;
1564 }
1565 }
1566
1567 termPQExpBuffer(&errorBuf);
1568 return connOptions;
1569}
1570
1571/* ----------------
1572 * PQsetdbLogin

Callers 7

InitPgFdwOptionsFunction · 0.85
dblink_fdw_validatorFunction · 0.85
get_connect_stringFunction · 0.85
mainFunction · 0.85
do_connectFunction · 0.85
check_pghost_envvarFunction · 0.85
mainFunction · 0.85

Calls 5

initPQExpBufferFunction · 0.85
conninfo_initFunction · 0.85
conninfo_add_defaultsFunction · 0.85
PQconninfoFreeFunction · 0.85
termPQExpBufferFunction · 0.85

Tested by 1

mainFunction · 0.68