We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parente9cdb00 commitfa4dad6Copy full SHA for fa4dad6
contrib/pg_upgrade/function.c
@@ -227,8 +227,24 @@ check_loadable_libraries(void)
227
char*cmd= (char*)pg_malloc(8+2*llen+1);
228
PGresult*res;
229
230
+/*
231
+ *In Postgres 9.0, Python 3 support was added, and to do that, a
232
+ *plpython2u language was created with library name plpython2.so
233
+ *as a symbolic link to plpython.so. In Postgres 9.1, only the
234
+ *plpython2.so library was created, and both plpythonu and
235
+ *plpython2u pointing to it. For this reason, any reference to
236
+ *library name "plpython" in an old PG <= 9.1 cluster must look
237
+ *for "plpython2" in the new cluster.
238
+ */
239
+if (GET_MAJOR_VERSION(old_cluster.major_version)<901&&
240
+strcmp(lib,"$libdir/plpython")==0)
241
+{
242
+lib="$libdir/plpython2";
243
+llen=strlen(lib);
244
+}
245
+
246
strcpy(cmd,"LOAD '");
-PQescapeStringConn(conn,cmd+6,lib,llen,NULL);
247
+PQescapeStringConn(conn,cmd+strlen(cmd),lib,llen,NULL);
248
strcat(cmd,"'");
249
250
res=PQexec(conn,cmd);