Skip to content

Commit

Permalink
#1043 bug fix: create index if not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielwol committed Oct 2, 2024
1 parent 677f5bd commit 4e8ed3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gis/gccview/gcc_puller_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def create_partitioned_table(output_table, return_json, schema_name, con):
schema_parent_table = sql.Identifier(schema_name, output_table))
cur.execute(create_sql, (today_string, ))

index_sql = sql.SQL("CREATE INDEX {idx_name} ON {schema_child_table} USING gist (geom)").format(idx_name=sql.Identifier(index_name),
index_sql = sql.SQL("CREATE INDEX IF NOT EXISTS {idx_name} ON {schema_child_table} USING gist (geom)").format(idx_name=sql.Identifier(index_name),
schema_child_table=sql.Identifier(schema_name, output_table_with_date))
cur.execute(index_sql)

Expand Down

0 comments on commit 4e8ed3e

Please sign in to comment.