To the list -

I'm converting shapefiles to postgres tables using ogr2ogr. As usual with ogr2ogr, it works very well.

Now I want to automatically add an extra column "created" with the current timestamp during the ogr2ogr operation.

Something like this:

ogr2ogr .....  -sql "SELECT *, CURRENT_TIMESTAMP AS created FROM point_data" ....

Shapefile name is "point_data.shp" and CURRENT_TIMESTAMP is a SQL92 standard function

However, It doesn't work. Is there some way, I can add this timestamp value to the resulting table using a built-in function in ogr2ogr?

(The above command works, if you replace "CURRENT_TIMESTAMP" with ex. "OGR_TYPE". Obviously It doesn't produce a timestamp after this edit ;-)

Kind regards
Bo Victor Thomsen




_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to