Releases: osm2pgsql-dev/osm2pgsql
Release 2.1.1
Release 2.1.0
This is a bugfix and maintenance release. The main visible change is that osm2pgsql now works better together with connection poolers and similar database middleware: prepared statements now use protocol level prepare instead of PREPARE sql commands and there is a new option to explicitly create a primary key on flex tables.
Other fixes and features:
- check flat node file format for forwards compatibility to prepare for future changes of the flatnode file format
- fix two-stage processing when flat node file is used
- fix getting node locations in slim node with two-stage processing
- updated included libosmium, protozero and fmt libraries
Release 2.0.1
This release fixes some small issues with 2.0.0:
- fix forwarding of
--schema
parameter from osm2pgsql-replication to osm2pgsql - install
osm2pgsql_find_changed_ways
function in the right schema (thanks @falko17) - install osm2pgsql-gen binary by default
Release 2.0.0
The day has finally arrived where we are releasing version 2.0.0. of osm2pgsql, five years after the release of 1.0.0.
This release marks a milestone in modernizing osm2pgsql. We removed a lot of accumulated cruft from more than a decade of development. This makes osm2pgsql easier to understand for users and for developers. And it has allowed us to solve some long-standing issues and will allow further improvements in the future.
Major breaking changes:
- The legacy format for the middle tables has been removed as well as the old non-bucket way node index.
- The gazetteer output (used by Nominatim) has been removed.
- Several command line options have been removed and others are checked more strictly.
- There are some new library requirements and Lua is not optional any more.
- The
add_row()
function in the flex Lua config has been removed, useinsert()
instead. - Check that Lua functions on OSM object are called correctly using the colon-syntax.
- Handling of untagged objects and object attributes has changed.
Please see the Upgrading appendix for the details of these changes. We suggest you update to version 1.11.0 first and resolve any issues you see there before upgrading to version 2.0.0.
This is the first release that deprecates the "pgsql" output, please start moving towards the "flex" output instead. See this FAQ entry for the details.
New features in the flex output:
- Two-stage processing now also supports node members of relations, not only way members
- Optionally build id index as unique index
- Allow setting the names of indexes in the database
- New after_nodes|ways|relations() processing functions in flex Lua config files
- Make osm2pgsql properties available in Lua in osm2pgsql.properties table
- Add get_bbox() function to geometries in Lua
- Allow empty config file in flex output, useful for some corner uses
Changes in the generalization code:
- Add tile-based generalizer calling SQL commands
- Fix: Do not run ANALYZE in append mode, autovacuum will do that for us
- Fix: Handle errors in threads correctly stopping the program with an error message
Other fixes and features:
- Make --flat-nodes also work in non-slim mode, useful if memory is tight
- Fix off-by-one error in expire code generating out of bounds tiles
- Property changes are stored later to database to avoid changing the database if anything breaks
- Report (up to 100) missing nodes in the input file (in debug log)
- Simplified code for area assembly from multipolygon relations
- Replication: guess state from file when state info is not available
- Flush and close COPYs after nodes, ways, and relations in flex output avoid COPYs that are open for a long time
- Remove special case for old PostGIS versions when clustering
- Avoid looking for parents of new nodes and ways in the database middle speeding up changes
- As always: Lots of code cleanups, refactorings and small fixes
Release 1.11.0
This release makes the new middle database format the default. If you have not switched already, you need to reimport your database to take advantage of that.
We have changed the way we are parsing the command line options. The new code uses the CLI11 library (a copy of which is included in the repository) and is much cleaner and also much stricter. You now get warnings (and sometimes errors) for many combinations of options that don't make sense. Please check the output from osm2pgsql and osm2pgsql-replication for such messages and fix your command lines accordingly. Note especially that duplicated options are not allowed any more. This can happen, for instance, when using osm2pgsql-replication which adds the database connection parameters (such as -d
) when it calls osm2pgsql.
If all goes well this will be the last release starting with a 1. We are planning for a version 2.0.0 in the second quarter of 2024. In that release we will remove all the functionality that has been deprecated. We will also remove support for the legacy database middle format and only support the new format introduced in version 1.9.0.
Further changes:
- The number of database connections that osm2pgsql was opening could be quite large as it was depending on the number of tables. This is no longer the case. Osm2pgsql is opening far fewer connections now, usually you will not need to change the PostgreSQL
max_connections
settings any more. - Osm2pgsql now adds the context (the part of osm2pgsql responsible for a database connection) and the connection number to the application name used in the database connection. This allows you to better monitor what osm2pgsql is doing using the
pg_stat_activity
table in the database. - Bugfix: Using the new database format with
-x, --extra-attributes
did not work due to a wrong SQL command. This is fixed now.
Many thanks to Thunderforest who supported development of the features in this release.
Release 1.10.0
This is a relatively small but still important release.
The new middle table format has changed slightly: the tags
field can now be NULL
. This makes storage more efficient and indexing faster. The new middle format is now declared stable and production ready. To use it, use the command line option --middle-database-format=new
, in a future version of osm2pgsql this will become the new default. If you have used this option already with one of the 1.9.x versions of osm2pgsql you have to reload your database or use this SQL command to update the table: ALTER TABLE <name> ALTER COLUMN tags DROP NOT NULL;
, for <name>
use planet_osm_nodes
, planet_osm_ways
, and planet_osm_rels
or the equivalents if you are using a different table name prefix.
Other changes:
- Emit a warning that the flex output
area
type and theadd_row()
functions are deprecated if you use them. If you get this warning, read https://osm2pgsql.org/doc/tutorials/switching-from-add-row-to-insert/ . - Add first/last timestamps to expire tables. Having these timestamps allows various expire/updating strategies.
- The
docs
directory is now calledman
, because it only contains the man pages. All other docs are on the project web site. - Various improvements on the (still experimental) generalization code. The biggest change is that we switch from using the CImg to the OpenCV library which makes the code an order of magnitude faster.
Release 1.9.2
This release fixes a bug introduced in 1.9.0 with two-stage processing that will lead to crashes. If you are using any 1.9.x version, please upgrade to 1.9.2.
In one case we had some performance problems updating an osm2pgsql database with 1.9.1 due to the PostgreSQL query planning choosing a bad plan. This release contains a workaround for that problem.
We also improved the (experimental) generalizer code a bit:
- More information is shown in log level 'info', including some timing information.
- The Lua config
run_sql()
command now can have either a single SQL statement in thesql
field (as before) or a list of SQL commands. - For convenience, the Lua config
run_sql()
command now has an optionaltransaction
field which can be set totrue
to wrap the SQL commands in BEGIN/COMMIT. - The new
if_has_rows
fields on therun_sql()
command can be set to string with an SQL query. If that field is set, the SQL statement(s) in thesql
field is only run, if the SQL query returns at least one row. - Some performance improvements in low-level code in the generalizer.
Release 1.9.1
This release fixes some small issues with 1.9.0:
- Fix compatibility of osm2pgsql-replication with psycopg3
- Fix architecture-dependent double to integer conversion
- Some small code cleanups
Release 1.9.0
This release brings three new major features:
- a new osm2pgsql_properties table that saves command line options and reuses them on updates
- a new database middle saves raw OSM data in JSONB format and is explicitly designed to be queried by the user
- the new (and still experimental) osm2pgsql-gen adds geometry generalization to osm2pgsql (thanks @joto)
Other changes include:
- cleanup of schema handling
- tile expiry output into database tables
- a new
spherical_area()
function for flex config files to calculate the area of a (multi)polygon on the sphere. - when using the new database middle, the
--middle-with-nodes
option allows you to store all tagged nodes in the database (with their tags and location). - several improvements to osm2pgsql-replication to make it more flexible and better tested (thanks to @amandasaurus and @JakobMiksch)
- don't do multi-statement SQL queries to be compatible with the PgPool-II connection pooler.
Please note that this version drops support for implicit DB schema other than public. If you rely on implict user schemas or custom schema paths, you now must configure the schema to be used with the --schema
option.
To compile osm2pgsql some new libraries are needed, please see the README.md for details.
For more information on all new features and changes read the more extensive release notes for 1.9.0.
Release 1.8.1
This release contains some fixes and minor changes.
- Fix
osm2pgsql-replication
script so it works correctly with PostgreSQL schemas. - Don't process objects without tags in outputs in append mode. This should speed up updates a little bit.
- Count number of inserted rows and rows not inserted because of NOT NULL constraints for each table and log the numbers in debug mode.
- Remove some extra-verbose debug logging when using the
pole_of_inaccessibility()
function. - Flush output tables generated from nodes and ways tables earlier.