Skip to content
Snippets Groups Projects
Commit 7e6e50bb authored by Pierre-Gilles Levallois's avatar Pierre-Gilles Levallois
Browse files

set search path

parent 65fbd6e4
No related branches found
No related tags found
No related merge requests found
Pipeline #103950 passed with warnings
......@@ -199,6 +199,9 @@ def connectDB(params_DB, jsonEnable = False):
else:
cur = conn.cursor()
# Set Schema 'base'
cur.execute(f'SET search_path TO base')
return conn, cur
except (Exception, psycopg2.Error) as error :
......@@ -359,7 +362,7 @@ def insertGDFintoDB(DB_params, DB_schema, gdf, tablename, columnsListToDB):
# Insert with copy_from
try:
cur.copy_from(buffer, DB_schema + "." + tablename, sep=";", columns=columnsListToDB)
cur.copy_from(buffer, tablename, sep=";", columns=columnsListToDB)
conn.commit()
except (Exception, psycopg2.DatabaseError) as error:
debugLog(style.RED, "Error while inserting : {}".format(error), logging.ERROR)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment