Project

General

Profile

« Previous | Next » 

Revision 5529

sql.py: Added copy_table()

View differences:

lib/sql.py
1400 1400
    '''Creates a structure-only copy of a table. (Does not copy data.)'''
1401 1401
    create_table(db, dest, has_pkey=False, col_indexes=False, like=src)
1402 1402

  
1403
def copy_table(db, src, dest):
1404
    '''Creates a copy of a table, including data'''
1405
    copy_table_struct(db, src, dest)
1406
    insert_select(db, dest, None, mk_select(db, src))
1407

  
1403 1408
### Data
1404 1409

  
1405 1410
def truncate(db, table, schema='public', **kw_args):

Also available in: Unified diff