multiline PL/Python function fails in *.sql
От | Wolfgang Rohdewald |
---|---|
Тема | multiline PL/Python function fails in *.sql |
Дата | |
Msg-id | 200312031052.52819.wolfgang@rohdewald.de обсуждение исходный текст |
Ответы |
Re: multiline PL/Python function fails in *.sql
Re: multiline PL/Python function fails in *.sql |
Список | pgsql-novice |
Hi, as the subject says - if I do the same interactively in the interpreter, it works. I tried plsql < x.sql and plsql -f x.sql, both fail with this code: create function myfunc(text) RETURNS text AS ' plpy.notice("hallo Notiz")' LANGUAGE 'plpython'; ERROR: plpython: Unable to compile function myfunc exceptions.SyntaxError: invalid syntax (line 2) This works OK in x.sql: create function myfunc(text) RETURNS text AS 'plpy.notice("hallo Notiz")' LANGUAGE 'plpython'; but multiline only works when using psql interactively. This seems to be python specific, as this one also works with plsql -f x.sql: create function simple(text) returns text as ' BEGIN RETURN $1 || $1 ; END; ' LANGUAGE 'plpgsql'; BTW I am using PostgreSQL 7.3.4 -- Wolfgang
В списке pgsql-novice по дате отправления: