I have a .bak file (74GB) containing all my database webapp
from Postgres 12.1 generated via the following .bash cronjob:
#!/bin/bash
backupfolder=”/home/backups/database/postgresql"
day=$(date+%Y%m%d)
su postgres −c ”pg_dump webapp > $backupfolder/$day.bak”
The version of pg_dump
is 10.19
.
Today when I tried to restore the database to the same version of postgres (12.1)
psql webbackup < /home/backups/database/postgresql/20220111.bak
with another name for testing purposes, it was all going well until this message shows up:
...
COPY 20997
COPY 3217
ERROR: missing data for column "fecha"
CONTEXT: COPY valores, line 106982440: "17779705"
As you can see, the copy of the other tables went okay, but then it comes to this error with the table "valores" and the process just shut down.
if I check the versions I get:
$ pg_dump -V
pg_dump (PostgreSQL) 10.19 (Ubuntu 10.19-0ubuntu0.18.04.1)
$ pg_restore -V
pg_restore (PostgreSQL) 10.19 (Ubuntu 10.19-0ubuntu0.18.04.1)
$ psql -V
psql (PostgreSQL) 12.1 (Ubuntu 12.1-1.pgdg18.04+1)
Why is this happening? Is there any way to read the backup file to find the error?