(self, tbl, curs, fn, whr)
Dump table to disk.
Dump table to disk.
Dump table to disk .
def dump_table(self, tbl, curs, fn, whr):
        """Dump table to disk."""
        cols = ','.join(self.fq_common_fields)
        if len(whr) == 0:
            whr = 'true'
        q = "copy (SELECT %s FROM %s WHERE %s) to stdout" % (cols, skytools.quote_fqident(tbl), whr)
        self.log.debug("Query: %s", q)
        f = open(fn, "w", 64*1024)
        curs.copy_expert(q, f)
        size = f.tell()
        f.close()
        self.log.info('%s: Got %d bytes', tbl, size)
def dump_table ( self , tbl , curs , fn , whr ) : cols = ',' . join ( self . fq_common_fields ) if len ( whr ) == 0 : whr = 'true' q = "copy (SELECT %s FROM %s WHERE %s) to stdout" % ( cols , skytools . quote_fqident ( tbl ) , whr ) self . log . debug ( "Query: %s" , q ) f = open ( fn , "w" , 64 * 1024 ) curs . copy_expert ( q , f ) size = f . tell ( ) f . close ( ) self . log . info ( '%s: Got %d bytes' , tbl , size )