ERROR: function data.sppr_purge_table(character varying, character varying, integer) does not exist

While trying to upgrade by running upgrade.sh build is getting failed with below exception.

[java] 2021-08-18 17:53:11,466 ( SQLLoaderInternal) INFO - Starting on /turtle-reserved/tmp/schema/generated/postgres/update/statements

[java] 2021-08-18 17:53:11,480 ( ConnectionWrapper) INFO - Attempting to load profile “install.postgres”:

[java] 2021-08-18 17:53:11,481 ( ConnectionWrapper) INFO - Type: postgres

[java] 2021-08-18 17:53:11,482 ( ConnectionWrapper) INFO - Class: org.postgresql.Driver

[java] 2021-08-18 17:53:11,482 ( ConnectionWrapper) INFO - URL: jdbc:postgresql://vpce-018a31a1ce598623e-sdczmtua.vpce-svc-0ed30df23b7d33bf6.us-west-2.vpce.amazonaws.com:8194/mfldev01

[java] 2021-08-18 17:53:11,483 ( ConnectionWrapper) INFO - User: pegaadmin

[java] 2021-08-18 17:53:11,483 ( ConnectionWrapper) INFO - JDBC Properties:

[java] 2021-08-18 17:53:11,734 ( ConnectionWrapper) INFO - Autocommit set to true

[java] 2021-08-18 17:53:11,737 ( SQLLoaderInternal) INFO - File: postgres00010.sql

[java] 2021-08-18 17:53:11,738 ( SQLLoaderInternal) INFO - DROP FUNCTION DATA.SPPR_PURGE_TABLE(VARCHAR,VARCHAR,INT)

[java] 2021-08-18 17:53:11,743 ( SQLLoaderInternal) INFO - Failed to execute SQL in file postgres00010.sql

[java]

[java] org.postgresql.util.PSQLException: ERROR: function data.sppr_purge_table(character varying, character varying, integer) does not exist

[java] at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2552)

[java] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2284)

[java] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:322)

[java] at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:481)

[java] at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:401)

[java] at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:322)

[java] at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:308)

[java] at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:284)

[java] at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:279)

[java] at com.pega.pegarules.install.SQLLoaderInternal.readAndExecuteSQLStatements(SQLLoaderInternal.java:160)

[java] at com.pega.pegarules.install.SQLLoaderInternal.load(SQLLoaderInternal.java:119)

@shravanp7060 it’s complaining about missing function in your data schema: sppr_purge_table

@SUMAN_GUMUDAVELLY it was issue with cache tables, i have truncated tables and ran upgrade.sh file its sucessful.