def col_defn(col_data, i):
    """
    returns individual column creation statement; excluding indexes and keys

    used with iterations, i = str(i) where i is index of current iterations
    """
    type_field = col_data['type_' + i]
    length_field = col_data['length_' + i]
    name_field = col_data['name_' + i]
    key_field = col_data['key_' + i]
    sql_stmt = ' {name} {type}'.format(name=name_field, type=type_field)
    if type_field in ('bit', 'bit varying', 'character varying',
        'character', 'interval'):
        sql_stmt += '({length_' + i + '})'
    if length_field and (type_field.startswith('time') or type_field.
        startswith('timestamp')):
        _in = 9 if type_field.startswith('timestamp') else 4
        sql_stmt = ' {name} {type_prefix} ({length}) {type_postfix}'.format(
            type_prefix=type_field[0:_in], length=length_field,
            type_postfix=type_field[_in + 1:])
    sql_stmt += ' NOT NULL' if col_data['not_null_' + i] else ''
    d = {'primary': 'PRIMARY KEY', 'unique': 'UNIQUE', 'index': 'INDEX'}
    if key_field:
        sql_stmt += ' ' + d[key_field] if key_field != 'unique' else ''
    return sql_stmt
