@@ -12,6 +12,8 @@ Feature: Tests for including extra attributes
1212 { column = 'version', type = 'int4' },
1313 { column = 'changeset', type = 'int4' },
1414 { column = 'timestamp', type = 'int4' },
15+ { column = 'timestamp_ts', type = 'timestamp' },
16+ { column = 'timestamp_ts_tz', type = 'timestamptz' },
1517 { column = 'uid', type = 'int4' },
1618 { column = 'user', type = 'text' },
1719 { column = 'geom', type = 'linestring', not_null = true },
@@ -20,7 +22,10 @@ Feature: Tests for including extra attributes
2022
2123 function osm2pgsql.process_way(object)
2224 object.geom = object:as_linestring()
23- attr_table:insert(object)
25+ a = object
26+ a.timestamp_ts = a.timestamp
27+ a.timestamp_ts_tz = a.timestamp
28+ attr_table:insert(a)
2429 end
2530 """
2631
@@ -36,8 +41,8 @@ Feature: Tests for including extra attributes
3641 | --slim |
3742
3843 Then table osm2pgsql_test_attr contains
39- | type | way_id | tags ->'highway ' | tags ->'osm_version ' | version | changeset | timestamp | uid | "user " |
40- | way | 20 | primary | NULL | 1 | 31 | 1578832496 | 17 | test |
44+ | type | way_id | tags ->'highway ' | tags ->'osm_version ' | version | changeset | timestamp | timestamp_ts :: text | to_char ( timestamp_ts_tz AT TIME ZONE ' UTC ', ' YYYY - MM - DD " T " HH24 : MI : SS " Z "') | uid | "user " |
45+ | way | 20 | primary | NULL | 1 | 31 | 1578832496 | 2020 - 01 - 12 12 : 34 : 56 | 2020 - 01 - 12T12 : 34 : 56Z | 17 | test |
4146
4247 Given the grid
4348 | | |
@@ -46,8 +51,8 @@ Feature: Tests for including extra attributes
4651 | --slim | --append |
4752
4853 Then table osm2pgsql_test_attr contains
49- | type | way_id | tags ->'highway ' | tags ->'osm_version ' | version | changeset | timestamp | uid | "user " |
50- | way | 20 | primary | NULL | NULL | NULL | NULL | NULL | NULL |
54+ | type | way_id | tags ->'highway ' | tags ->'osm_version ' | version | changeset | timestamp | timestamp_ts | timestamp_ts_tz | uid | "user " |
55+ | way | 20 | primary | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL |
5156
5257
5358 Scenario : Importing data with extra attributes
0 commit comments