Written by James McDonald

May 18, 2023

Error while running a restore

ERROR: invalid input syntax for type timestamp with time zone: "202"
COPY 4

Restore Command (I use docker but that isn’t the problem)

zcat ${RECOVERY_FILE} | docker run --env PGPASSWORD -i --rm \
    postgres:14.5 psql -d ${DB_NAME} \
    -h ${DB_HOST} -p ${DB_PORT} -U ${DB_USER}

Cause

Corrupt backup file. Rerun backup

Backup Command

docker run --env PGPASSWORD --rm \
    postgres:14.5 pg_dump --clean -d ${DB_NAME} -h ${DB_HOST} \
    -p ${DB_PORT} -U ${DB_USER} | gzip > ${BACKUP_TO}

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Robocopy exclude Directories

Just trying to copy everything except a couple of directories from a drive to my NAS This is the secret incantation of...