I'm trying to build a GUI that allows replacement / update of the PostGIS database that holds my OSM extract (which I use for rendering, typical mapnik / tile server arrangement).
I'd like to show the user when the data that is already loaded was "current" to. That is, if my PBF extract (from http://download.geofabrik.de/) "contains all OSM data up to 2016-07-06T19:29:02Z", then I'd like to show the "2016-07-06T19:29:02Z" part in the GUI.
However I don't know how to get that from the database.
From http://wiki.openstreetmap.org/wiki/PBF_Format I see there is a
osmosis_replication_timestamp field in the header, but I don't see how to retrieve that with just osm2pgsql.
At this stage, I'm thinking about either to "shell out" to something like osmosis, or trying to parse the HeaderBlock myself. I'd then have to store that (perhaps in the database, perhaps in my local state, perhaps as a file like the mod_tile approach). Both options suffer from lack of integration with the import process (e.g. if someone does a command line import using osm2pgsql, my separate state won't reflect that import), so I end up having to track import date / timestamp pairs. Both osmosis and a parser are pretty heavy for one timestamp...
Is there a way to get the replication timestamp directly from the results of an osm2pgsql import?