←back to thread

75 points markusw | 1 comments | | HN request time: 0.24s | source
Show context
eirikbakke ◴[] No.45335495[source]
The PostgreSQL data directory format is not very stable or portable. You can't just ZIP it up and move it to a different machine, unless the new machine has the same architecture and "sufficiently" similar PostgreSQL binaries.

In theory the data directory works with any PostgreSQL binaries from the same major version of PostgreSQL, but I have seen cases where this fails e.g. because the binaries were from the same major version but compiled with different build options.

replies(5): >>45335952 #>>45336357 #>>45336495 #>>45336741 #>>45337960 #
oulipo2 ◴[] No.45336495[source]
So the alternative would be to just pg_dump / pg_restore the content? Is it an issue?
replies(3): >>45336699 #>>45336703 #>>45347794 #
1. eirikbakke ◴[] No.45347794[source]
That is the correct way to do it for PostgreSQL.

It does rule out some common SQLite use cases, such as using the database for app persistence. The app would never be able to upgrade the major version of PostgreSQL, unless it bundled PostgreSQL binaries for every major version ever used.