Skip to content

Commit 6455d07

Browse files
authored
use IF NOT EXISTS to allow for incremental runs of IMPORT SCHEMA (#47)
1 parent 355353c commit 6455d07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pglink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ chfdw_construct_create_tables(ImportForeignSchemaStmt *stmt, ForeignServer *serv
889889
}
890890

891891
initStringInfo(&buf);
892-
appendStringInfo(&buf, "CREATE FOREIGN TABLE %s.%s (\n",
892+
appendStringInfo(&buf, "CREATE FOREIGN TABLE IF NOT EXISTS %s.%s (\n",
893893
stmt->local_schema, table_name);
894894
query = psprintf("select name, type from system.columns where database='%s' and table='%s'", stmt->remote_schema, table_name);
895895
table_def = conn.methods->simple_query(conn.conn, query);

0 commit comments

Comments
 (0)