13 #include "catalog/pg_language_d.h"
31 const char *str1 = ((
const LibraryInfo *) p1)->name;
33 size_t slen1 = strlen(str1);
34 size_t slen2 = strlen(str2);
35 int cmp = strcmp(str1, str2);
75 "SELECT DISTINCT probin "
76 "FROM pg_catalog.pg_proc "
77 "WHERE prolang = %u AND "
78 "probin IS NOT NULL AND "
103 for (rowno = 0; rowno < ntups; rowno++)
120 for (
int slotno = 0; slotno < slot_arr->
nslots; slotno++)
150 int was_load_failure =
false;
154 prep_status(
"Checking for presence of required libraries");
156 snprintf(output_path,
sizeof(output_path),
"%s/%s",
171 int llen = strlen(lib);
178 strcpy(cmd,
"LOAD '");
186 was_load_failure =
true;
188 if (script == NULL && (script =
fopen_priv(output_path,
"w")) == NULL)
189 pg_fatal(
"could not open file \"%s\": %m", output_path);
190 fprintf(script,
_(
"could not load library \"%s\": %s"),
195 was_load_failure =
false;
200 if (was_load_failure)
201 fprintf(script,
_(
"In database: %s\n"),
211 pg_fatal(
"Your installation references loadable libraries that are missing from the\n"
212 "new installation. You can add these libraries to the new installation,\n"
213 "or remove the functions using them from the old installation. A list of\n"
214 "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)
int count_old_cluster_logical_slots(void)
static void check_ok(void)
static int pg_cmp_s32(int32 a, int32 b)
static int pg_cmp_size(size_t a, size_t b)
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)
LogicalSlotInfoArr slot_arr
#define FirstNormalObjectId