Project

General

Profile

« Previous | Next » 

Revision 6976

sql.py: DbConn._db(): search_path: Don't append the existing search_path, because it usually includes the public schema, which is now different from the schema being imported into. This fixes a bug where sql.function_exists() would find public-schema functions in both the public schema and the import's schema because both were in the search_path, causing a DuplicateException "more than one function named ...". Note that the elements of the existing search_path are no longer needed now that vegbien_dest's $schemas includes $public. Also note that if an instance of DbConn does not specify the schemas param, the existing search_path will be left as-is rather than overwritten with an empty list.

View differences:

lib/sql.py
244 244
                    psycopg2.extensions.ISOLATION_LEVEL_READ_COMMITTED)
245 245
            if schemas != None:
246 246
                search_path = [self.esc_name(s) for s in schemas.split(',')]
247
                search_path.append(value(run_query(self, 'SHOW search_path',
248
                    log_level=4)))
249 247
                run_query(self, 'SET search_path TO '+(','.join(search_path)),
250 248
                    log_level=3)
251 249
        

Also available in: Unified diff