Revision 5568
Added by Aaron Marcuse-Kubitza about 12 years ago
sql_io.py | ||
---|---|---|
223 | 223 |
|
224 | 224 |
##### Import |
225 | 225 |
|
226 |
row_num_col_def = copy.copy(sql.row_num_col_def) |
|
227 |
row_num_col_def.name = 'row_num' |
|
228 |
|
|
226 | 229 |
def append_csv(db, table, stream_info, stream, use_copy_from=True): |
227 | 230 |
assert sql.table_col_names(db, table) == stream_info.header |
228 | 231 |
|
Also available in: Unified diff
sql_io.py: Added row_num_col_def for use by import_csv(). The row_num column will be necessary again because PostgreSQL unfortunately does not return rows in inserted order (or any stable order: "If sorting is not chosen, the rows will be returned in an unspecified order [which] must not be relied on" <http://www.postgresql.org/docs/8.3/static/queries-order.html>), so an explicit ORDER BY is always needed to ensure staging table rows are retrievable in the order they were inserted.