Skip to content

Commit

Permalink
fix: add warning for python_path guc
Browse files Browse the repository at this point in the history
  • Loading branch information
yihong0618 committed Apr 14, 2022
1 parent 9cb01d6 commit 8324d34
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/pl/plpython/plpy_main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* PL/Python main entry points
*
* src/pl/plpython/plpy_main.c
Expand All @@ -17,6 +17,8 @@
#include "utils/rel.h"
#include "utils/syscache.h"

#include "cdb/cdbvars.h"

#include "plpython.h"

#include "plpy_main.h"
Expand Down Expand Up @@ -86,6 +88,12 @@ bool PLy_add_path = false;
// need to add ifdef
#if PY_MAJOR_VERSION >= 3
char *plpython3_path = NULL;
void
assign_plpython3_python_path(const char *newval, void *extra)
{
if (Gp_role != GP_ROLE_EXECUTE)
ereport(WARNING, (errmsg("PYTHONPATH for plpython3 can only set once in one session")));
}
#endif

void
Expand Down Expand Up @@ -151,7 +159,9 @@ _PG_init(void)
&plpython3_path,
NULL,
PGC_USERSET, 0,
NULL, NULL, NULL);
NULL,
assign_plpython3_python_path,
NULL);
#endif
pg_bindtextdomain(TEXTDOMAIN);
}
Expand Down

0 comments on commit 8324d34

Please sign in to comment.