Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,30 @@ These issues are caused by using `pg_dump` and `pg_restore` versions that are no
To solve these issues, upgrade your `pg_dump` and/or `pg_restore` modules:

- You can upgrade them by installing PostgreSQL 16 which includes these tools.
- If you are using a third-party tool that includes these libraries, upgrade your tool. For instance, pgAdmin supports PostgreSQL 16 ecosystem from version 7.8.
- If you are using a third-party tool that includes these libraries, upgrade your tool. For instance, pgAdmin supports PostgreSQL 16 ecosystem from version 7.8.

## Automated backup fails due to long-running queries

### Problem

When performing long-running queries (lasting several hours or days), backup operations might not be performed successfully. Backup status will then appear as `error` or `unknown_status`.

### Cause

These issues are caused by queries locking database rows (usually long running transactions), preventing logical backup operations from reading database rows.

### Solution

To solve these issues, stop these queries:

- List PostgreSQL processes and identify the ones that have been running transactions since several hours ('xact_start' colmun) with the following command:
```
SELECT pid, state, usename, query, xact_start, query_start FROM pg_stat_activity ORDER BY xact_start;
```
- Stop the corresponding queries with:
```
SELECT pg_cancel_backend({pid});
```
Where `{pid}` is the process id from the long-running query causing the issue (`pid` column of the previous step).

Alternatively, you can also stop long-running queries using a graphical PostgreSQL client such as [pgAdmin](https://www.pgadmin.org/) or [DBeaver](https://dbeaver.io/).