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

Function connection_warnings

src/bin/psql/command.c:3546–3592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3544
3545
3546void
3547connection_warnings(bool in_startup)
3548{
3549 if (!pset.quiet && !pset.notty)
3550 {
3551 int client_ver = PG_VERSION_NUM;
3552 char cverbuf[32];
3553 char sverbuf[32];
3554
3555 if (pset.sversion != client_ver)
3556 {
3557 const char *server_version;
3558
3559 /* Try to get full text form, might include "devel" etc */
3560 server_version = PQparameterStatus(pset.db, "server_version");
3561 /* Otherwise fall back on pset.sversion */
3562 if (!server_version)
3563 {
3564 formatPGVersionNumber(pset.sversion, true,
3565 sverbuf, sizeof(sverbuf));
3566 server_version = sverbuf;
3567 }
3568
3569 printf(_("%s (%s, server %s)\n"),
3570 pset.progname, PG_VERSION, server_version);
3571 }
3572 /* For version match, only print psql banner on startup. */
3573 else if (in_startup)
3574 printf("%s (%s)\n", pset.progname, PG_VERSION);
3575
3576 if (pset.sversion / 100 > client_ver / 100)
3577 printf(_("WARNING: %s major version %s, server major version %s.\n"
3578 " Some psql features might not work.\n"),
3579 pset.progname,
3580 formatPGVersionNumber(client_ver, false,
3581 cverbuf, sizeof(cverbuf)),
3582 formatPGVersionNumber(pset.sversion, false,
3583 sverbuf, sizeof(sverbuf)));
3584
3585#ifdef WIN32
3586 if (in_startup)
3587 checkWin32Codepage();
3588#endif
3589 printSSLInfo();
3590 printGSSInfo();
3591 }
3592}
3593
3594
3595/*

Callers 3

mainFunction · 0.85
CheckConnectionFunction · 0.85
do_connectFunction · 0.85

Calls 5

PQparameterStatusFunction · 0.85
formatPGVersionNumberFunction · 0.85
checkWin32CodepageFunction · 0.85
printSSLInfoFunction · 0.85
printGSSInfoFunction · 0.85

Tested by

no test coverage detected