In the process of building a new virtual machine, I got a little bit confused and accidentally fed osm2pgsql the old style LUA script "style.lua" that is in the main folder when you create an osm2pgsql install using a Git clone, while having the "-O flex" option set on the command line.
Of course, this is wrong input, but nonetheless osm2pgsql did not error out. It actually went through the first stages of loading data, visibly showing progress loading nodes, ways and relations, then stopped without throwing an error, yet the output showed it did not generate e.g. indexes. When I inspected the resulting database, no table was there, the database was empty, so the changes did not get committed.
I think it would be good, with now two backends using different type LUA scripts, that osm2pgsql somehow can distinguish old style LUA scripts and throw a user friendly error to warn users of the wrong input, to prevent this type of issue of mixing up "old" pgsql and "new" flex type LUA scripts.
In the process of building a new virtual machine, I got a little bit confused and accidentally fed osm2pgsql the old style LUA script "style.lua" that is in the main folder when you create an osm2pgsql install using a Git clone, while having the "-O flex" option set on the command line.
Of course, this is wrong input, but nonetheless osm2pgsql did not error out. It actually went through the first stages of loading data, visibly showing progress loading nodes, ways and relations, then stopped without throwing an error, yet the output showed it did not generate e.g. indexes. When I inspected the resulting database, no table was there, the database was empty, so the changes did not get committed.
I think it would be good, with now two backends using different type LUA scripts, that osm2pgsql somehow can distinguish old style LUA scripts and throw a user friendly error to warn users of the wrong input, to prevent this type of issue of mixing up "old" pgsql and "new" flex type LUA scripts.