To resolve pre-upgrade check violations, extension incompatibilities, and
resource limit errors when you perform an in-place major version upgrade in
AlloyDB for PostgreSQL, apply the recommended fixes for the error messages that your
upgrade operation returns. For general upgrade troubleshooting steps, see
[Troubleshoot an in-place major version upgrade](https://docs.cloud.google.com/alloydb/docs/troubleshoot/troubleshoot-database-inplace-major-version-upgrade.md.txt).

## Common major version upgrade errors

The following sections describe the error messages that can occur during a major
version upgrade and how to resolve them.

### Error: Database: database_name. extension_violation: DEPRECATED, action_required: DELETE_EXTENSION

**Description:** AlloyDB detects a deprecated extension. The error
indicates which extensions caused an error:

```
database_name. extension_violation: DEPRECATED_EXTENSION, action_required: DELETE_EXTENSION. Query format to delete the extensions: DROP EXTENSION {extension_name}; Violation list: [extensions]
```

**Recommended fix:** Delete the extension. The query format to delete an
extension is `DROP EXTENSION {extension_name};`.

### Error: Database: database_name. extension_violation: INVALID_EXTENSION_VERSION, action_required: UPGRADE_EXTENSION

**Description:** AlloyDB detects an invalid extension version.

**Recommended fix:** Upgrade the extension. The query format to upgrade an
extension is `ALTER EXTENSION {extension_name} UPDATE TO {target_version};`.

### Error: Database: database_name contains pg_largeobject

**Description:** AlloyDB detects `pg_largeobject`.

**Recommended fix:** Remove `pg_largeobject` before upgrading the
AlloyDB cluster.

### ERROR: out of shared memory

**Description:** If the instance has insufficient shared memory, you might see
this error message. This error is more likely to occur if you have more than
10,000 tables.

**Recommended fix:** Before you start an upgrade, set the value of the
[`max_locks_per_transaction`](https://docs.cloud.google.com/alloydb/docs/reference/database-flags.md.txt#postgres-m)
flag to approximately twice the number of tables in the instance. The instance
is restarted when you change the value of this flag.

### ERROR: Insufficient connections

**Description:** If your instance has insufficient connection capacity, you
might see this error message.

**Recommended fix:** We recommend that you increase the
[`max_connections`](https://docs.cloud.google.com/alloydb/docs/reference/database-flags.md.txt#postgres-m)
flag value by the number of databases in your instance. When you change the
value of this flag, the instance is restarted.

### Pre-upgrade checks are failing

**Description:** When you upgrade your AlloyDB cluster, your
upgrade might fail due to pre-upgrade checks. Details about the violations are
in the API response in the form of `logs_url`. You are directed to
the Google Cloud console page where the logs are present.

**Recommended fix:** Based on the error message, see other errors listed earlier in this document to resolve the specific issue.

## What's next

- [Troubleshoot an in-place major version upgrade](https://docs.cloud.google.com/alloydb/docs/troubleshoot/troubleshoot-database-inplace-major-version-upgrade.md.txt).
- Learn how to [perform a database in-place major version upgrade](https://docs.cloud.google.com/alloydb/docs/upgrade-db-inplace-major-version.md.txt).