Skip to content

Commit 506e755

Browse files
authored
Merge pull request #1330 from joto/no-alter-table-in-append-pgsql
Pgsql output: Remove code that alters table in append mode
2 parents fc99fbd + 2acad7c commit 506e755

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)