When a PolarDB for PostgreSQL error occurs, the error message includes an error code and a condition name. Use this page to identify the error category, understand the cause, and apply the correct fix.
Connection exceptions
Connection exceptions occur when an application or client fails to connect to the database. Common symptoms:
-
A connection that was successfully created no longer exists
-
The connection times out
-
The client cannot reach the database instance
Cause: Connection exceptions typically occur when the network is temporarily interrupted or when the database service restarts.
Resolution: Add retry logic to your application so it automatically reconnects when a connection drops. If reconnecting still fails, contact us.
Data exceptions
Data exceptions cover errors such as invalid function parameters, incorrect array indexes, division by zero, invalid data types, and invalid escape characters.
Resolution:
-
Look up the error in Error codes using the error code and the
condition name. -
Identify the exact SQL statement where the error occurred.
-
Fix the SQL statement and rerun it.
Syntax errors
Syntax errors occur in SQL statements when you reference undefined columns, functions, tables, or parameters, or when you create duplicate columns, databases, functions, tables, or aliases.
Resolution: The error message identifies both the SQL statement where the error occurred and its error class. Fix the issue based on the error message and rerun the statement.
Insufficient resources
Insufficient resources are commonly caused by:
| Cause | Recommended action |
|---|---|
| Out of disk space | Upgrade the instance specification |
| Out of memory (OOM) | Upgrade the instance specification |
| Too many connections | See below |
| Excessive usage of other resources | Upgrade the instance specification |
Too many connections
A high connection count can result from any of the following:
-
An application opens too many connections simultaneously, exceeding the connection limit
-
Slow queries hold connections open longer than expected
-
CPU or memory shortages cause a backlog of pending connections
To resolve the issue:
-
Reduce the number of active connections.
-
Identify and optimize slow or inefficient SQL statements.