Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a3401be

Browse files
committed
Use different function names for plpython3 handlers, to avoid clashes in
pg_pltemplate This should have a catversion bump, but it's still being debated whether it's worth it during beta.
1 parent e849b49 commit a3401be

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/include/catalog/pg_pltemplate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $PostgreSQL: pgsql/src/include/catalog/pg_pltemplate.h,v 1.13 2010/01/22 15:45:15 petere Exp $
11+
* $PostgreSQL: pgsql/src/include/catalog/pg_pltemplate.h,v 1.14 2010/06/29 00:18:11 petere Exp $
1212
*
1313
* NOTES
1414
* the genbki.pl script reads this file and generates .bki
@@ -74,6 +74,6 @@ DATA(insert ( "plperl" t t "plperl_call_handler" "plperl_inline_handler" "plper
7474
DATA(insert ( "plperlu" f f "plperl_call_handler" "plperl_inline_handler" "plperl_validator" "$libdir/plperl" _null_ ));
7575
DATA(insert ( "plpythonu" f f "plpython_call_handler" "plpython_inline_handler" _null_ "$libdir/plpython" _null_ ));
7676
DATA(insert ( "plpython2u" f f "plpython_call_handler" "plpython_inline_handler" _null_ "$libdir/plpython2" _null_ ));
77-
DATA(insert ( "plpython3u" f f "plpython_call_handler" "plpython_inline_handler" _null_ "$libdir/plpython3" _null_ ));
77+
DATA(insert ( "plpython3u" f f "plpython3_call_handler" "plpython3_inline_handler" _null_ "$libdir/plpython3" _null_ ));
7878

7979
#endif /* PG_PLTEMPLATE_H */

src/pl/plpython/plpython.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**********************************************************************
22
* plpython.c - python as a procedural language for PostgreSQL
33
*
4-
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.144 2010/06/10 04:05:01 tgl Exp $
4+
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.145 2010/06/29 00:18:11 petere Exp $
55
*
66
*********************************************************************
77
*/
@@ -244,6 +244,12 @@ typedef struct PLyResultObject
244244

245245
/* function declarations */
246246

247+
#if PY_MAJOR_VERSION >= 3
248+
/* Use separate names to avoid clash in pg_pltemplate */
249+
#define plpython_call_handler plpython3_call_handler
250+
#define plpython_inline_handler plpython3_inline_handler
251+
#endif
252+
247253
/* exported functions */
248254
Datum plpython_call_handler(PG_FUNCTION_ARGS);
249255
Datum plpython_inline_handler(PG_FUNCTION_ARGS);

0 commit comments

Comments
 (0)