13 #include "catalog/pg_language_d.h"
30 const char *str1 = ((
const LibraryInfo *) p1)->name;
32 int slen1 = strlen(str1);
33 int slen2 = strlen(str2);
34 int cmp = strcmp(str1, str2);
72 "SELECT DISTINCT probin "
73 "FROM pg_catalog.pg_proc "
74 "WHERE prolang = %u AND "
75 "probin IS NOT NULL AND "
94 for (rowno = 0; rowno < ntups; rowno++)
124 int was_load_failure =
false;
128 prep_status(
"Checking for presence of required libraries");
130 snprintf(output_path,
sizeof(output_path),
"%s/%s",
145 int llen = strlen(lib);
152 strcpy(cmd,
"LOAD '");
160 was_load_failure =
true;
162 if (script == NULL && (script =
fopen_priv(output_path,
"w")) == NULL)
163 pg_fatal(
"could not open file \"%s\": %s",
165 fprintf(script,
_(
"could not load library \"%s\": %s"),
170 was_load_failure =
false;
175 if (was_load_failure)
176 fprintf(script,
_(
"In database: %s\n"),
186 pg_fatal(
"Your installation references loadable libraries that are missing from the\n"
187 "new installation. You can add these libraries to the new installation,\n"
188 "or remove the functions using them from the old installation. A list of\n"
189 "problem libraries is in the file:\n"
static void PGresult const char * p2
static void PGresult * res
char * PQerrorMessage(const PGconn *conn)
void PQfinish(PGconn *conn)
size_t PQescapeStringConn(PGconn *conn, char *to, const char *from, size_t length, int *error)
ExecStatusType PQresultStatus(const PGresult *res)
int PQntuples(const PGresult *res)
PGresult * PQexec(PGconn *conn, const char *query)
char * PQgetvalue(const PGresult *res, int tup_num, int field_num)
char * pg_strdup(const char *in)
void * pg_malloc(size_t size)
void check_loadable_libraries(void)
static int library_name_compare(const void *p1, const void *p2)
void get_loadable_libraries(void)
static void check_ok(void)
void void pg_log(eLogType type, const char *fmt,...) pg_attribute_printf(2
#define fopen_priv(path, mode)
PGconn * connectToServer(ClusterInfo *cluster, const char *db_name)
void prep_status(const char *fmt,...) pg_attribute_printf(1
PGresult * executeQueryOrDie(PGconn *conn, const char *fmt,...) pg_attribute_printf(2
#define qsort(a, b, c, d)
static int cmp(const chr *x, const chr *y, size_t len)
#define FirstNormalObjectId