diff options
author | Bruce Momjian <bruce@momjian.us> | 2003-06-25 01:18:58 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2003-06-25 01:18:58 +0000 |
commit | afb17d912b4cb39dc31346dbb1d4816d5d0d687c (patch) | |
tree | 067cb0cb7958696a386084e24c47c70525c5cd9a /src/pl/plpython/plpython_function.sql | |
parent | b24a0293cc867ec0ad0a924ae976cc6ab9d12f90 (diff) | |
download | postgresql-afb17d912b4cb39dc31346dbb1d4816d5d0d687c.tar.gz postgresql-afb17d912b4cb39dc31346dbb1d4816d5d0d687c.zip |
> I've worked with the Pl/Python code in the past and will see about removing
> rexec and making it an untrusted language. Last time I looked, it didn't
> look particularly difficult. I've set aside some time next week, so stay
> tuned.
Attached is a patch that removes all of the RExec code from plpython from
the current PostgreSQL CVS. In addition, plpython needs to be changed to an
untrusted language in createlang. Please let me know if there are any
problems.
Kevin Jacobs
Diffstat (limited to 'src/pl/plpython/plpython_function.sql')
-rw-r--r-- | src/pl/plpython/plpython_function.sql | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/src/pl/plpython/plpython_function.sql b/src/pl/plpython/plpython_function.sql index 2769e9de36f..82a3c0c9598 100644 --- a/src/pl/plpython/plpython_function.sql +++ b/src/pl/plpython/plpython_function.sql @@ -34,7 +34,7 @@ return SD["call"] CREATE FUNCTION import_fail() returns text AS 'try: - import socket + import foosocket except Exception, ex: plpy.notice("import socket failed -- %s" % str(ex)) return "failed as expected" @@ -304,30 +304,5 @@ CREATE OR REPLACE FUNCTION read_file(text) RETURNS text AS ' CREATE OR REPLACE FUNCTION write_file(text,text) RETURNS text AS ' open(args[0],"w").write(args[1]) + return "Wrote to file: %s" % args[0] ' LANGUAGE 'plpython'; - -CREATE OR REPLACE FUNCTION getpid() RETURNS int4 AS ' - import os - return os.getpid() -' LANGUAGE 'plpython'; - -CREATE OR REPLACE FUNCTION uname() RETURNS int4 AS ' - import os - return os.uname() -' LANGUAGE 'plpython'; - -CREATE OR REPLACE FUNCTION sys_exit() RETURNS text AS ' - import sys - return sys.exit() -' LANGUAGE 'plpython'; - -CREATE OR REPLACE FUNCTION sys_argv() RETURNS text AS ' - import sys - return str(sys.argv) -' LANGUAGE 'plpython'; - -CREATE OR REPLACE FUNCTION sys_version() RETURNS text AS ' - import sys - return str(sys.version) -' LANGUAGE 'plpython'; - |