# PostgreSQL - Database Configuration Issues - OPS0009 ALERT

**URL:** <https://forums.pega.com/t/postgresql-database-configuration-issues-ops0009-alert/3187>\
**Category:** Pega-as-a-Service\
**Tags:** updates, manufacturing, client-managed-cloud, devops, installation-and-deployment, system-administration, 8-6-3, system-cloud-ops-administrator\
**Created:** [September 2, 2022, 12:59pm UTC](https://forums.pega.com/t/postgresql-database-configuration-issues-ops0009-alert/3187 "2022-09-02T12:59:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kishore\_Sanagapalli](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/kishore_sanagapalli/32/4954_2.png) [@Kishore\_Sanagapalli](https://forums.pega.com/u/Kishore_Sanagapalli)\
**Post date:** [September 2, 2022, 12:59pm UTC](https://forums.pega.com/t/postgresql-database-configuration-issues-ops0009-alert/3187/1 "2022-09-02T12:59:48Z")

</div>

**Issue Description** :

[MSG][Error in RDB-Delete][STACK][com.pega.pegarules.pub.database.DatabaseException: There was a problem getting a list: code: 0 SQLState: 42P01 Message: ERROR: relation “pg\_stat\_statements” does not exist  
Position: 48  
DatabaseException caused by prior exception: org.postgresql.util.PSQLException: ERROR: relation “pg\_stat\_statements” does not exist  
Position: 48  
| SQL Code: 0 | SQL State: 42P01

From: (BHFFYJ9XUVGOVHIY4E50MIRFNLIS1W294A)  
SQL: SELECT count(pg\_stat\_statements\_reset() ) from pg\_stat\_statements limit 1

Caused by SQL Problems.  
Problem #1, SQLState 42P01, Error code 0: org.postgresql.util.PSQLException: ERROR: relation “pg\_stat\_statements” does not exist

---

<div class="post-metadata">

**Author:** ![Kishore\_Sanagapalli](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/kishore_sanagapalli/32/4954_2.png) [@Kishore\_Sanagapalli](https://forums.pega.com/u/Kishore_Sanagapalli)\
**Post date:** [September 2, 2022, 1:08pm UTC](https://forums.pega.com/t/postgresql-database-configuration-issues-ops0009-alert/3187/2 "2022-09-02T13:08:36Z")

</div>

@SaikishoreS16598123

Root Cause: The issue occurs sometimes during the upgrades.

you have to specify the schema of pg\_stat\_statements and validate the result with below query.

For example: SELECT count(public.pg\_stat\_statements\_reset() ) from public.pg\_stat\_statements limit 1;

**Solution: In-order to fix the issue,**

1. We need to validate the relation of existing schemas has relation to public level from the Search\_path is pointed to correct schemas or not.

2. Need to check with DBA if pg\_stat\_statements is enabled in the environment or not. If not, make sure it gets enabled by DBA.

3. Last step: Identify the Operator ID configured in DB to access the application and excute the below query to alter the role

ALTER ROLE admin SET search\_path TO pg\_catalog,public,,public;

Note: Operator ID is admin in our scenario.

For More Reference: [https://www.postgresql.org/docs/11/pgstatstatements.html](https://www.postgresql.org/docs/11/pgstatstatements.html)

Note: **The above solution is applied in our environment and the issue has been resolved successfully. The Post will be kept open for any other best solutions and comments.**
