Skip to main content

Analyze Schema Statistics

  • December 6, 2019
  • 1 reply
  • 3 views

ersaurabhex
Forum|alt.badge.img+1

https://www.vertica.com/blog/analyze-statistics-schema-level-part-2-quick-tip/
Based on above knowledge tips, I created a function but i have trouble giving access to individual database users. Only DBA user is able to run that.

1 reply

Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • December 6, 2019

Did you grant the EXECUTE privilege?

Example:

dbadmin=> CREATE USER joe;
CREATE USER

dbadmin=> GRANT EXECUTE ON PROCEDURE analyze_schema_statistics(schema_name VARCHAR) TO joe;
GRANT PRIVILEGE

dbadmin=> \c - joe
You are now connected as user "joe".

dbadmin=> SELECT analyze_schema_statistics('test_stats');
 analyze_schema_statistics
---------------------------
                         0
(1 row)