Search Postgresql Archives

Re: How to 'register' functions, so they can be called (plpythonu)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



blay bloo wrote:
I am defining some functions using plpythonu, through the standard means.

Here I have one function (test1) which calls another (testfunc). When
I excute this I get the following error:

ERROR:  plpython: function "test1" failed
DETAIL:  <type 'exceptions.NameError'>: global name 'testfunc' is not defined

You need to call it as an SQL statement "SELECT testfunc(...)"

However, from the console, select testfunc('test') works fine.

I believe the python embedder mangles the function names when it loads them into PG, so you can't call them directly.

--
  Richard Huxton
  Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux