You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the user always needs the id index, they can force the index build
even in non-slim (or slim+drop) mode by setting the `create_index`
option of the `ids` setting in the define_table() Lua command to
`always`. The default is `autpo` which means: Only build the index in
slim mode.
See #1854
The test runner (steps_db.py) has been extended so that the
table_exists() check also checks for views, so that we can access the
data in the pg_catalog.pg_indexes view.
Copy file name to clipboardExpand all lines: tests/bdd/flex/lua-index-definitions.feature
+61Lines changed: 61 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -476,3 +476,64 @@ Feature: Index definitions in Lua file
476
476
Then SELECT schemaname, tablename FROM pg_catalog.pg_indexes WHERE tablename = 'mytable' AND indexdef LIKE '%USING btree (name)%' AND indexdef LIKE '%WHERE (name = lower(name))%'
477
477
| schemaname | tablename |
478
478
| public | mytable |
479
+
480
+
Scenario: Don't create id index if the configuration doesn't mention it
481
+
Given the input file 'liechtenstein-2013-08-03.osm.pbf'
482
+
And the lua style
483
+
"""
484
+
local t = osm2pgsql.define_table({
485
+
name = 'mytable',
486
+
ids = { type = 'node', id_column = 'node_id' },
487
+
columns = {
488
+
{ column = 'name', type = 'text' },
489
+
{ column = 'tags', type = 'jsonb' },
490
+
{ column = 'geom', type = 'geometry' },
491
+
}
492
+
})
493
+
"""
494
+
When running osm2pgsql flex
495
+
Then table pg_catalog.pg_indexes has 0 rows with condition
496
+
"""
497
+
schemaname = 'public' AND tablename = 'mytable' AND indexname LIKE '%node_id%'
498
+
"""
499
+
500
+
Scenario: Don't create id index if the configuration doesn't says so
501
+
Given the input file 'liechtenstein-2013-08-03.osm.pbf'
0 commit comments