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…

Clear HSTS Settings in CHrome

Open chrome://net-internals/#hsts enter the domain in the query field and click Query to confirm it has HSTS settings...

Ubuntu on Hyper-v

It boils town to installing linux-azure # as root or sudo apt-get update apt-get install linux-azure...