Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcfe443a

Browse files
committed
In pg_upgrade, when checking for the plpython library, we must check for
"plpython2" when upgrading from pre-PG 9.1. Patch to head and 9.1.Per report from Peter.
1 parentb95aec5 commitcfe443a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

‎contrib/pg_upgrade/function.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,24 @@ check_loadable_libraries(void)
228228
char*cmd= (char*)pg_malloc(8+2*llen+1);
229229
PGresult*res;
230230

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+
231247
strcpy(cmd,"LOAD '");
232-
PQescapeStringConn(conn,cmd+6,lib,llen,NULL);
248+
PQescapeStringConn(conn,cmd+strlen(cmd),lib,llen,NULL);
233249
strcat(cmd,"'");
234250

235251
res=PQexec(conn,cmd);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp