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
.create="CREATE TABLE %p_nodes (id int4 PRIMARY KEY USING INDEX TABLESPACE %i, lat int4 not null, lon int4 not null, tags text[]) TABLESPACE %t;\n",
66
+
.create="CREATE TABLE %p_nodes (id int4 PRIMARY KEY {USING INDEX TABLESPACE %i}, lat int4 not null, lon int4 not null, tags text[]) {TABLESPACE %t};\n",
67
67
.prepare="PREPARE insert_node (int4, int4, int4, text[]) AS INSERT INTO %p_nodes VALUES ($1,$2,$3,$4);\n"
68
68
#else
69
-
.create="CREATE TABLE %p_nodes (id int4 PRIMARY KEY USING INDEX TABLESPACE %i, lat double precision not null, lon double precision not null, tags text[]) TABLESPACE %t;\n",
69
+
.create="CREATE TABLE %p_nodes (id int4 PRIMARY KEY {USING INDEX TABLESPACE %i}, lat double precision not null, lon double precision not null, tags text[]) {TABLESPACE %t};\n",
70
70
.prepare="PREPARE insert_node (int4, double precision, double precision, text[]) AS INSERT INTO %p_nodes VALUES ($1,$2,$3,$4);\n"
71
71
#endif
72
72
"PREPARE get_node (int4) AS SELECT lat,lon,tags FROM %p_nodes WHERE id = $1 LIMIT 1;\n"
.create="CREATE TABLE %p_ways (id int4 PRIMARY KEY USING INDEX TABLESPACE %i, nodes int4[] not null, tags text[], pending boolean not null) TABLESPACE %t;\n",
88
-
.create_index="CREATE INDEX %p_ways_idx ON %p_ways (id) TABLESPACE %i WHERE pending;\n",
89
-
.array_indexes="CREATE INDEX %p_ways_nodes ON %p_ways USING gin (nodes gin__int_ops) TABLESPACE %i;\n",
87
+
.create="CREATE TABLE %p_ways (id int4 PRIMARY KEY {USING INDEX TABLESPACE %i}, nodes int4[] not null, tags text[], pending boolean not null) {TABLESPACE %t};\n",
88
+
.create_index="CREATE INDEX %p_ways_idx ON %p_ways (id) {TABLESPACE %i} WHERE pending;\n",
89
+
.array_indexes="CREATE INDEX %p_ways_nodes ON %p_ways USING gin (nodes gin__int_ops) {TABLESPACE %i};\n",
90
90
.prepare="PREPARE insert_way (int4, int4[], text[], boolean) AS INSERT INTO %p_ways VALUES ($1,$2,$3,$4);\n"
91
91
"PREPARE get_way (int4) AS SELECT nodes, tags, array_upper(nodes,1) FROM %p_ways WHERE id = $1;\n"
92
92
"PREPARE way_done(int4) AS UPDATE %p_ways SET pending = false WHERE id = $1;\n"
pgsql_exec(sql_conn, PGRES_COMMAND_OK, "ALTER TABLE %s ALTER COLUMN way SET NOT NULL;\n", tables[i].name);
1220
1224
/* slim mode needs this to be able to apply diffs */
1221
-
if (Options->slim)
1222
-
pgsql_exec(sql_conn, PGRES_COMMAND_OK, "CREATE INDEX %s_pkey ON %s USING BTREE (osm_id) TABLESPACE %s;\n", tables[i].name, tables[i].name, Options->tblsmain_index);
1225
+
if (Options->slim) {
1226
+
sprintf(sql, "CREATE INDEX %s_pkey ON %s USING BTREE (osm_id)", tables[i].name, tables[i].name);
pgsql_exec(sql_conn, PGRES_COMMAND_OK, "ALTER TABLE %s_tmp RENAME TO %s;\n", table->name, table->name);
1344
-
pgsql_exec(sql_conn, PGRES_COMMAND_OK, "CREATE INDEX %s_index ON %s USING GIST (way GIST_GEOMETRY_OPS) TABLESPACE %s;\n", table->name, table->name, Options->tblsmain_index);
1345
-
/* slim mode needs this to be able to apply diffs */
1346
-
if( Options->slim )
1347
-
pgsql_exec(sql_conn, PGRES_COMMAND_OK, "CREATE INDEX %s_pkey ON %s USING BTREE (osm_id) TABLESPACE %s;\n", table->name, table->name, Options->tblsmain_index);
1348
-
pgsql_exec(sql_conn, PGRES_COMMAND_OK, "GRANT SELECT ON %s TO PUBLIC;\n", table->name);
pgsql_exec(sql_conn, PGRES_COMMAND_OK, "ALTER TABLE %s_tmp RENAME TO %s;\n", table->name, table->name);
1353
+
if (Options->tblsmain_index) {
1354
+
pgsql_exec(sql_conn, PGRES_COMMAND_OK, "CREATE INDEX %s_index ON %s USING GIST (way GIST_GEOMETRY_OPS) TABLESPACE %s;\n", table->name, table->name, Options->tblsmain_index);
1355
+
} else {
1356
+
pgsql_exec(sql_conn, PGRES_COMMAND_OK, "CREATE INDEX %s_index ON %s USING GIST (way GIST_GEOMETRY_OPS);\n", table->name, table->name);
1357
+
}
1358
+
1359
+
/* slim mode needs this to be able to apply diffs */
1360
+
if (Options->slim)
1361
+
{
1362
+
if (Options->tblsmain_index) {
1363
+
pgsql_exec(sql_conn, PGRES_COMMAND_OK, "CREATE INDEX %s_pkey ON %s USING BTREE (osm_id) TABLESPACE %s;\n", table->name, table->name, Options->tblsmain_index);
1364
+
} else {
1365
+
pgsql_exec(sql_conn, PGRES_COMMAND_OK, "CREATE INDEX %s_pkey ON %s USING BTREE (osm_id);\n", table->name, table->name);
1366
+
}
1367
+
}
1368
+
pgsql_exec(sql_conn, PGRES_COMMAND_OK, "GRANT SELECT ON %s TO PUBLIC;\n", table->name);
0 commit comments