def refresh_indices(self):
self.logger.info("trying to create the indices on schemas %s and %s" %(self.pg_conn.dest_schema, self.pg_conn.schema_obf))
for index in self.idx_ddl:
idx_ddl= self.idx_ddl[index]
for sql_idx in idx_ddl:
path_clear = "SET search_path=%s;" % self.pg_conn.dest_schema
path_obf = "SET search_path=%s;" % self.pg_conn.schema_obf
sql_clear = "%s %s" %(path_clear , sql_idx)
sql_obf = "%s %s" %(path_clear , path_obf)
try:
self.logger.info("Executing %s on %s" %(sql_idx, self.pg_conn.dest_schema))
self.pg_conn.pgsql_cur.execute(sql_clear)
except psycopg2.Error as e:
self.logger.error("SQLCODE: %s SQLERROR: %s" % (e.pgcode, e.pgerror))
try:
self.logger.info("Executing %s on %s" %(sql_idx, self.pg_conn.schema_obf))
self.pg_conn.pgsql_cur.execute(sql_obf)
except psycopg2.Error as e:
self.logger.error("SQLCODE: %s SQLERROR: %s" % (e.pgcode, e.pgerror))
评论列表
文章目录