Project

General

Profile

« Previous | Next » 

Revision 2893

sql.py: DbConn._db(): Setting search_path: Use `SET search_path` and `SHOW search_path` instead of combining the old and new search_paths in SQL itself using `SELECT set_config('search_path', ...)`

View differences:

sql.py
194 194
            if self.serializable and not self.autocommit: self.run_query(
195 195
                'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE', log_level=4)
196 196
            if schemas != None:
197
                schemas_ = ''.join((esc_name(self, s)+', '
198
                    for s in schemas.split(',')))
199
                self.run_query("SELECT set_config('search_path', "
200
                    +self.esc_value(schemas_)
201
                    +" || current_setting('search_path'), false)", log_level=3)
197
                search_path = [self.esc_name(s) for s in schemas.split(',')]
198
                search_path.append(value(run_query(self, 'SHOW search_path',
199
                    log_level=4)))
200
                run_query(self, 'SET search_path TO '+(','.join(search_path)),
201
                    log_level=3)
202 202
        
203 203
        return self.__db
204 204
    

Also available in: Unified diff