Issue in gprestore ERROR: function already exists with same argument types
search cancel

Issue in gprestore ERROR: function already exists with same argument types

book

Article ID: 382742

calendar_today

Updated On:

Products

VMware Tanzu Greenplum Greenplum

Issue/Introduction

When running gprestore, functions fail due to the following error:

ERROR: function "plr_call_handler" already exists with same argument types

Cause

When plr introduced the CREATE EXTENSION way to install the language, which conflicts with the old plain install script plr.sql thereby, if the user executed plr.sql before, the CREATE EXTENSION will fail since the types and functions have been created by the SQL before.

Resolution

At this time there is no uninstallation script, therefore we need to drop those conflict types and then create the extension.

The example is as follows:

gpadmin@centos7_0:~$ psql test
 psql (9.4.24)
 Type "help" for help.
 
 test=# create extension plr;
 ERROR:  function "plr_call_handler" already exists with same argument types
 test=# drop function plr_call_handler() ;
 DROP FUNCTION
 test=# drop function plr_environ ();
 DROP FUNCTION
 test=# drop type plr_environ_type ;
 DROP TYPE
 test=# drop type r_typename ;
 DROP TYPE
 test=# drop type r_version_type ;
 DROP TYPE
 test=# create extension plr;
 CREATE EXTENSION