3 ms·
Yeah, I know what you mean. Best suggestion I have is to get really familiar with pg_dump and pg_restore. It's really quite a powerful pair of tools with a lot
by grzm 9y ago
Yeah, I know what you mean. Best suggestion I have is to get really familiar with pg_dump and pg_restore. It's really quite a powerful pair of tools with a lot of options. The COPY command is also really flexible if you'd like to use CSV for interop with non-PG tools. Likely this is all stuff you already know. At the end of the day, I consider it just part of massaging data between systems.
FWIW, you can zip up and move a data directory around with some caveats: the data directory stores the data in ways specific to how the PostgreSQL binary was built (including Postgres version), so if the environment and build is the same, you're often fine. However, that's not a great method if you're looking for portability.
- rspeer 9y agoI am using the COPY command; it's faster than pg_restore, as far as I can tell. The COPY plus building the index is the part that takes a few hours and doesn't fit well into Docker.
- grzm 9y agoIt depends on how you're using pg_dump: you can choose to dump data and indexes separately. I suspect your COPY + index builds are comparable to the pg_restore, depending on your degree of parallelism with the index builds.