clkao / plv8js-migrated

Automatically exported from code.google.com/p/plv8js
Other
0 stars 0 forks source link

Can't call functions from plv8.start_proc under other user than postgres #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Can't call functions from plv8.start_proc under other user than postgres

Set up startup procedure in config

plv8.start_proc = 'plv8_startup'

Created function:

CREATE OR REPLACE FUNCTION plv8_startup ()
RETURNS void AS
$body$

  this.hello = function(name){
     return name + ', hello!';
  };

$body$
LANGUAGE 'plv8'
VOLATILE
CALLED ON NULL INPUT
SECURITY DEFINER
COST 100;

Under postgres user everything works well:

DO $$ 
  plv8.elog(NOTICE, hello('John'));
$$ LANGUAGE plv8;

the result - John, hello! Then created user test and tryed to run the function:

ERROR: ReferenceError: hello is not defined
SQL-состояние: XX000

tryied to grant user test on execute plv8_startup - the result is the same. 
What is wrong?

Original issue reported on code.google.com by vovapjat...@gmail.com on 12 Jan 2014 at 10:05

GoogleCodeExporter commented 9 years ago
Sorry, function has been created not in public schema
Please delete this issue

Original comment by vovapjat...@gmail.com on 13 Jan 2014 at 12:26

GoogleCodeExporter commented 9 years ago
I do it, too :) never mind.

Original comment by umi.tan...@gmail.com on 15 Jan 2014 at 5:02