Skip to main content
Question

How to use function

  • September 30, 2020
  • 2 replies
  • 13 views

yamakawa
Forum|alt.badge.img+1

Hi.
Sorry for the rudimentary question.
A user-defined function created by the DB administrator is passed to the
What do I need for general users to use it?

Anyway "alter function myfunction () owner to user;"
It's now available in, but I don't think it's a fundamental solution.

Thank you for your reply.

2 replies

mosheg
Forum|alt.badge.img+2
  • Participating Frequently
  • September 30, 2020

To see how to grant privileges on user-defined extension (UDx) to users and roles read this: https://www.vertica.com/docs/10.0.x/HTML/Content/Authoring/SQLReferenceManual/Statements/GRANT/GRANTUserDefinedExtension.htm
Please also verify that the granted user session include a PATH to your function Schema:
SHOW SEARCH_PATH;
And if needed: SET SEARCH_PATH to YOUR_FUNCTION_SCHEMA_NAME, public;


yamakawa
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • October 1, 2020

Thank you for an immediate answer.
Run the following command to make sure that user-defined functions are available to the general user.
@dbadmin
create fuction test_func() return date as begin ...end;
grant execute on function test_func() to public;
@general user
select test_func();
That's all, thank you.