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);
91 query =
psprintf(
"SELECT DISTINCT probin "
92 "FROM pg_catalog.pg_proc "
93 "WHERE prolang = %u AND "
94 "probin IS NOT NULL AND "
121 for (rowno = 0; rowno < ntups; rowno++)
138 for (
int slotno = 0; slotno < slot_arr->
nslots; slotno++)
169 int was_load_failure =
false;
173 prep_status(
"Checking for presence of required libraries");
175 snprintf(output_path,
sizeof(output_path),
"%s/%s",
190 int llen = strlen(lib);
197 strcpy(cmd,
"LOAD '");
205 was_load_failure =
true;
207 if (script == NULL && (script =
fopen_priv(output_path,
"w")) == NULL)
208 pg_fatal(
"could not open file \"%s\": %m", output_path);
209 fprintf(script,
_(
"could not load library \"%s\": %s"),
214 was_load_failure =
false;
219 if (was_load_failure)
220 fprintf(script,
_(
"In database: %s\n"),
230 pg_fatal(
"Your installation references loadable libraries that are missing from the\n"
231 "new installation. You can add these libraries to the new installation,\n"
232 "or remove the functions using them from the old installation. A list of\n"
233 "problem libraries is in the file:\n"
#define AssertVariableIsOfType(varname, typename)
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 void process_loadable_libraries(DbInfo *dbinfo, PGresult *res, void *arg)
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)
static struct LogicalRepInfo * dbinfo
UpgradeTask * upgrade_task_create(void)
void upgrade_task_run(const UpgradeTask *task, const ClusterInfo *cluster)
void void pg_log(eLogType type, const char *fmt,...) pg_attribute_printf(2
void upgrade_task_free(UpgradeTask *task)
#define fopen_priv(path, mode)
void(* UpgradeTaskProcessCB)(DbInfo *dbinfo, PGresult *res, void *arg)
PGconn * connectToServer(ClusterInfo *cluster, const char *db_name)
void prep_status(const char *fmt,...) pg_attribute_printf(1
void upgrade_task_add_step(UpgradeTask *task, const char *query, UpgradeTaskProcessCB process_cb, bool free_result, void *arg)
#define qsort(a, b, c, d)
char * psprintf(const char *fmt,...)
static int cmp(const chr *x, const chr *y, size_t len)
LogicalSlotInfoArr slot_arr
#define FirstNormalObjectId