gprestore reports : "ERROR: <schema>.<procedure_name>() is not a function"
search cancel

gprestore reports : "ERROR: <schema>.<procedure_name>() is not a function"

book

Article ID: 387293

calendar_today

Updated On:

Products

VMware Tanzu Data Suite Greenplum VMware Tanzu Greenplum VMware Tanzu Data Suite

Issue/Introduction

In the gprestore_YYYYMMDD.log ;

GRANT ALL ON FUNCTION schema01.myprocedure() TO schema; Error was: ERROR: schema01.myprocedure() is not a function (SQLSTATE 42809) 

In gpbackup_metadata.sql

$ grep schema01.myprocedure gpbackup_20250129203009_metadata.sql
CREATE PROCEDURE schema01.myprocedure() AS
ALTER PROCEDURE schema01.myprocedure() OWNER TO schema01;
REVOKE ALL ON FUNCTION schema01.myprocedure() FROM PUBLIC;
REVOKE ALL ON FUNCTION schema01.myprocedure() FROM role01;
GRANT ALL ON FUNCTION schema01.myprocedure() TO PUBLIC;
GRANT ALL ON FUNCTION schema01.myprocedure() TO role01;
GRANT ALL ON FUNCTION schema01.myprocedure() TO user; 

The permissions are revoked and granted on a "FUNCTION" instead of a "PROCEDURE". 

Cause

Procedures were introduced in Greenplum DB 7.x. When gpbackup creates the DDL for procedure and it's permissions, it creates "GRANT xx ON FUNCTION TO yy" statements instead of "GRANT xx ON PROCEDURE TO  yy".

The backup does not consider the new keyword PROCEDURE and column "prokind" in pg_proc table to generate the correct ACL statements.

Resolution

Currently, in January of 2025, a fix is in development and will be released in a future maintenance release of Greenplum Backup and Restore package