Live data from Hacker News

A PostgreSQL Docker container that automatically upgrades your database

github.com

91–93 of 93 posts

Re: A PostgreSQL Docker container that automatically upgrades your database

#91

Earlier quoted context omitted.

Yeah, this syntax looks a bit unwieldy: "${NEW}"/* But it's specifically to do wildcard expansion of the quoted string, and the shell interpreter is happy with it. I'm open to suggestions for improvements though. :) --- This is confusing to me: ... you can just make the list of files (maybe even write it to the file, maybe even write a batch file which would move them) and use it for moving the data from pgdata to ol…

> I'm not understanding what you're meaning here. If this was PowerShell then I would just get the list of files in $PGDATA, create folders and then move the files in the list, ie $files = gci $PGDATA try { New-item "$PGDATA/old" -erroraction stop New-item "$PGDATA/new" -erroraction stop } catch { throw "Failed to create the necessary dirs" } try { $files | Move-Item -Destination "$PGDATA/old" -erroraction stop } cat…

> "Failed to move pg_data, your databases are now borked, good luck"

:D

---

Oh. Now I understand the purpose of grabbing a file list first. That would allow for creating both old + new dirs first, prior to any move attempt.

I'll think it over. I'm kind of on the fence about it at first though. Lets see what I reckon after sleeping on it.

Thanks for following up btw. :)

Re: A PostgreSQL Docker container that automatically upgrades your database

#92

Earlier quoted context omitted.

A script creates a database instance from a container, restores backup into it, makes some checks (e.G. table sizes above some value, audit table contains data up to the backup point etc.), sends out email that everything looks ok.

Also unzipping and decrypting, already makes sure encryption worked and zipping worked and you did not end up with a 0 byte backup file (because of permission etc.). Same goes of course for snapshots and backups in the cloud. I have several clients which had backup problems because of misconfiguration in AWS/GCP.

super. I have been thinking of doing something similar for my productions db systems as well but was struggling to come up with some efficient way to test restoration. This gives me some starting point.

Re: A PostgreSQL Docker container that automatically upgrades your database

#93
post #92

Earlier quoted context omitted.

Also unzipping and decrypting, already makes sure encryption worked and zipping worked and you did not end up with a 0 byte backup file (because of permission etc.). Same goes of course for snapshots and backups in the cloud. I have several clients which had backup problems because of misconfiguration in AWS/GCP.

super. I have been thinking of doing something similar for my productions db systems as well but was struggling to come up with some efficient way to test restoration. This gives me some starting point.

You will be very happy when restoration testing fails. Better to find out in a test than - as some of my clients have - when restoring a backup in an emergency.
Post reply on HN