This section describes how to relocate OpenStreetMap data loaded using PgOSM Flex. These instructions apply to using an external Postgres database in single-import mode.
Do not use these instructions when using
--replication. Something will most likely break.
There are two common reasons you may want to relocate data. The same approach works for both of these scenarios.
- Snapshots over time
- Different regions
If your goal is to have the latest data always available, consider using replication instead.
PgOSM Flex always uses the
The best way to relocate data is to simply rename the schema. This quickly moves
existing data out of the way for future PgOSM Flex use. The following query
ALTER SCHEMA osm RENAME TO osm_2023_05;