@@ -65,17 +65,19 @@ std::size_t expire_output_t::output_tiles_to_table(
6565
6666 if (result.num_fields () == 3 ) {
6767 // old format with fields: zoom, x, y
68- db_connection.exec (" PREPARE insert_tiles(int4, int4, int4) AS"
69- " INSERT INTO {} (zoom, x, y) VALUES ($1, $2, $3)"
70- " ON CONFLICT DO NOTHING" ,
71- qn);
68+ db_connection.prepare (" insert_tiles" ,
69+ " INSERT INTO {} (zoom, x, y)"
70+ " VALUES ($1::int4, $2::int4, $3::int4)"
71+ " ON CONFLICT DO NOTHING" ,
72+ qn);
7273 } else {
7374 // new format with fields: zoom, x, y, first, last
74- db_connection.exec (" PREPARE insert_tiles(int4, int4, int4) AS"
75- " INSERT INTO {} (zoom, x, y) VALUES ($1, $2, $3)"
76- " ON CONFLICT (zoom, x, y)"
77- " DO UPDATE SET last = CURRENT_TIMESTAMP(0)" ,
78- qn);
75+ db_connection.prepare (" insert_tiles" ,
76+ " INSERT INTO {} (zoom, x, y)"
77+ " VALUES ($1::int4, $2::int4, $3::int4)"
78+ " ON CONFLICT (zoom, x, y)"
79+ " DO UPDATE SET last = CURRENT_TIMESTAMP(0)" ,
80+ qn);
7981 }
8082
8183 auto const count = for_each_tile (
0 commit comments