Skip to content

Commit fc99fbd

Browse files
authored
Merge pull request #1328 from joto/no-alter-table-in-append
Flex output: Remove code that alters table in append mode
2 parents 440ee07 + c3c69dd commit fc99fbd

1 file changed

Lines changed: 0 additions & 19 deletions

File tree

src/flex-table.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -167,25 +167,6 @@ void table_connection_t::start(bool append)
167167
table().has_geom_column() ? flex_table_t::table_type::interim
168168
: flex_table_t::table_type::permanent,
169169
table().full_name()));
170-
} else {
171-
//check the columns against those in the existing table
172-
auto const res = m_db_connection->query(
173-
PGRES_TUPLES_OK,
174-
"SELECT * FROM {} LIMIT 0"_format(table().full_name()));
175-
176-
for (auto const &column : table()) {
177-
if (res.get_column_number(column.name()) < 0) {
178-
log_info("Adding new column '{}' to '{}'", column.name(),
179-
table().name());
180-
m_db_connection->exec(
181-
"ALTER TABLE {} ADD COLUMN \"{}\" {}"_format(
182-
table().full_name(), column.name(),
183-
column.sql_type_name()));
184-
}
185-
// Note: we do not verify the type or delete unused columns
186-
}
187-
188-
//TODO: change the type of the geometry column if needed - this can only change to a more permissive type
189170
}
190171

191172
prepare();

0 commit comments

Comments
 (0)