Skip to content

Commit 2acad7c

Browse files
committed
Pgsql output: Remove code that alters table in append mode
This code is a half-measure that can detect some needed changes in your database tables when you change the config after import. But this was never tested properly and what is implemented is not enough to make this a useful feature. Fixes #1329
1 parent fc99fbd commit 2acad7c

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

src/table.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -123,24 +123,6 @@ void table_t::start(std::string const &conninfo, std::string const &table_space)
123123

124124
//create the table
125125
m_sql_conn->exec(sql);
126-
} //appending
127-
else {
128-
//check the columns against those in the existing table
129-
auto const res = m_sql_conn->query(
130-
PGRES_TUPLES_OK, "SELECT * FROM {} LIMIT 0"_format(qual_name));
131-
for (auto const &column : m_columns) {
132-
if (res.get_column_number(column.name) < 0) {
133-
log_info("Adding new column \"{}\" to \"{}\"", column.name,
134-
m_target->name);
135-
m_sql_conn->exec("ALTER TABLE {} ADD COLUMN \"{}\" {}"_format(
136-
m_target->name, column.name, column.type_name));
137-
}
138-
// Note: we do not verify the type or delete unused columns
139-
}
140-
141-
//TODO: check over hstore columns
142-
143-
//TODO: change the type of the geometry column if needed - this can only change to a more permissive type
144126
}
145127

146128
prepare();

0 commit comments

Comments
 (0)