Revision 4441
Added by Aaron Marcuse-Kubitza about 12 years ago
bin/csv2db | ||
---|---|---|
35 | 35 |
schema = opts.get_env_var('schema', 'public', env_names) |
36 | 36 |
has_row_num = opts.env_flag('has_row_num', True, env_names) |
37 | 37 |
db_config = opts.get_env_vars(sql.db_config_names, None, env_names) |
38 |
errors_table_only = opts.env_flag('errors_table_only', False, env_names) |
|
39 | 38 |
verbosity = util.cast(float, opts.get_env_var('verbosity', 3, env_names)) |
40 | 39 |
|
41 |
if not ((errors_table_only or input_cmd != []) and table != None |
|
42 |
and 'engine' in db_config): |
|
40 |
if not (input_cmd != [] and table != None and 'engine' in db_config): |
|
43 | 41 |
usage_err() |
44 | 42 |
|
45 | 43 |
# Connect to DB |
... | ... | |
123 | 121 |
log('Vacuuming and reanalyzing table') |
124 | 122 |
sql.vacuum(db, table) |
125 | 123 |
|
126 |
if not errors_table_only: |
|
127 |
try: load() |
|
128 |
except sql.DatabaseErrors, e: |
|
129 |
if use_copy_from[0]: # first try |
|
130 |
exc.print_ex(e, plain=True) |
|
131 |
use_copy_from[0] = False |
|
132 |
load() # try again with different approach |
|
133 |
else: raise |
|
124 |
try: load() |
|
125 |
except sql.DatabaseErrors, e: |
|
126 |
if use_copy_from[0]: # first try |
|
127 |
exc.print_ex(e, plain=True) |
|
128 |
use_copy_from[0] = False |
|
129 |
load() # try again with different approach |
|
130 |
else: raise |
|
134 | 131 |
|
135 | 132 |
main() |
Also available in: Unified diff
csv2db: Removed no longer used errors_table_only option