def fetch(self, pg_version):
        if 9.2 >= float(pg_version) and hasattr(self, 'post_92_query'):
            q = self.post_92_query
        else:
            q = self.query

        cursor = self.conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
        try:
            cursor.execute(q, self.parameters)
            rows = cursor.fetchall()
            for row in rows:
                # If row is length 2, assume col1, col2 forms key: value
                if len(row) == 2:
                    self.data.append({
                        'datname': self._translate_datname(self.dbname),
                        'metric': row[0],
                        'value': row[1],
                    })

                # If row > length 2, assume each column name maps to
                # key => value
                else:
                    for key, value in row.iteritems():
                        if key in ('datname', 'schemaname', 'relname',
                                   'indexrelname', 'funcname',):
                            continue

                        self.data.append({
                            'datname': self._translate_datname(row.get(
                                'datname', self.dbname)),
                            'schemaname': row.get('schemaname', None),
                            'relname': row.get('relname', None),
                            'indexrelname': row.get('indexrelname', None),
                            'funcname': row.get('funcname', None),
                            'metric': key,
                            'value': value,
                        })

        # Clean up
        finally:
            cursor.close()
dataset/ETHPy150Open BrightcoveOS/Diamond/src/collectors/postgres/postgres.py/QueryStats.fetch/swapped operands of `>=`