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 parentb95aec5 commitcfe443aCopy full SHA for cfe443a
contrib/pg_upgrade/function.c
@@ -228,8 +228,24 @@ check_loadable_libraries(void)
228
char*cmd= (char*)pg_malloc(8+2*llen+1);
229
PGresult*res;
230
231
+/*
232
+ *In Postgres 9.0, Python 3 support was added, and to do that, a
233
+ *plpython2u language was created with library name plpython2.so
234
+ *as a symbolic link to plpython.so. In Postgres 9.1, only the
235
+ *plpython2.so library was created, and both plpythonu and
236
+ *plpython2u pointing to it. For this reason, any reference to
237
+ *library name "plpython" in an old PG <= 9.1 cluster must look
238
+ *for "plpython2" in the new cluster.
239
+ */
240
+if (GET_MAJOR_VERSION(old_cluster.major_version)<901&&
241
+strcmp(lib,"$libdir/plpython")==0)
242
+{
243
+lib="$libdir/plpython2";
244
+llen=strlen(lib);
245
+}
246
+
247
strcpy(cmd,"LOAD '");
-PQescapeStringConn(conn,cmd+6,lib,llen,NULL);
248
+PQescapeStringConn(conn,cmd+strlen(cmd),lib,llen,NULL);
249
strcat(cmd,"'");
250
251
res=PQexec(conn,cmd);