Project

General

Profile

Statistics
| Revision:

# Date Author Comment
3522 07/20/2012 04:10 AM Aaron Marcuse-Kubitza

sql_gen.py: Added Array and to_Array()

3521 07/20/2012 02:47 AM Aaron Marcuse-Kubitza

sql_gen.py: Added List and inherit from it in Tuple

3520 07/20/2012 02:45 AM Aaron Marcuse-Kubitza

sql_gen.py: Renamed Tuple to Row and List to Tuple to more accurately reflect the datatype generated by each class (a Tuple being merely a grouping of values)

3519 07/20/2012 02:43 AM Aaron Marcuse-Kubitza

sql_gen.py: Moved Composite types to Literal values section as a subsection, since Composite types was really about just the input syntaxes for these types

3518 07/20/2012 02:32 AM Aaron Marcuse-Kubitza

sql_gen.py: Replaced srcs_str() with cross_join_srcs() which more correctly combines the srcs of each column using a Cartesian product. Eventually, the entire tree of srcs will need to be preserved instead of flattened in order to properly attribute errors to a specific column or set of columns.

3517 07/20/2012 02:03 AM Aaron Marcuse-Kubitza

sql_gen.py: srcs_str(): Fixed bug where needed to filter out columns with no srcs so that there aren't empty elements in the ","-separated list

3516 07/20/2012 02:00 AM Aaron Marcuse-Kubitza

sql_gen.py: Added has_srcs()

3515 07/20/2012 01:44 AM Aaron Marcuse-Kubitza

sql_gen.py: Added NestedExcHandler

3514 07/20/2012 01:44 AM Aaron Marcuse-Kubitza

sql_gen.py: Added srcs_str()

3513 07/20/2012 01:43 AM Aaron Marcuse-Kubitza

sql_gen.py: as_Col(): Support non-Code, non-string inputs by making them Literals

3512 07/20/2012 01:42 AM Aaron Marcuse-Kubitza

sql_gen.py: Added is_col() and use it in is_table_col()

3511 07/19/2012 11:54 PM Aaron Marcuse-Kubitza

sql_io.py: ExcToErrorsTable: Require users to explicitly specify an expression for the value that caused the error, instead of assuming that a variable named "value" already exists. This allows a value expression to be computed only if needed for error handling.

3510 07/19/2012 11:22 PM Aaron Marcuse-Kubitza

sql_gen.py: Moved repr() from ExcHandler to BaseExcHandler

3509 07/19/2012 11:21 PM Aaron Marcuse-Kubitza

sql_gen.py: Added BaseExcHandler and inherit from it in ExcHandlers

3508 07/19/2012 10:58 PM Aaron Marcuse-Kubitza

sql_io.py: cast(): Determining if will be saving errors: Don't add extra check if isinstance(col, sql_gen.Col) because the special case for sql_gen.Literal handles supported non-columns

3507 07/19/2012 10:56 PM Aaron Marcuse-Kubitza

sql_io.py: data_exception_handler(): Removed no longer needed db param

3506 07/19/2012 10:47 PM Aaron Marcuse-Kubitza

sql_io.py: Added ExcToErrorsTable, which separates out the errors table inserting code from the exception handling code. data_exception_handler(): Refactored to use new sql_gen.data_exception_handler() and ExcToErrorsTable.

3505 07/19/2012 10:43 PM Aaron Marcuse-Kubitza

sql_gen.py: Added data_exception_handler

3504 07/19/2012 10:08 PM Aaron Marcuse-Kubitza

sql_io.py: data_exception_handler(): Refactored to use new sql_gen.ExcToWarning when not using an errors table

3503 07/19/2012 10:03 PM Aaron Marcuse-Kubitza

sql_gen.py: Added ExcToWarning

3502 07/19/2012 10:02 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxondetermination: taxondetermination_taxonoccurrence_id_fkey(): Fixed bug where string containing a \-escape needed an "E" prefix

3501 07/19/2012 09:42 PM Aaron Marcuse-Kubitza

sql_io.py: data_exception_handler(): Require the caller to provide a statement to return a default value in case of error, rather than assuming the caller can accept a return value of NULL

3500 07/19/2012 09:27 PM Aaron Marcuse-Kubitza

sql_io.py: data_exception_handler(): Refactored to use new sql.define_func()

3499 07/19/2012 09:20 PM Aaron Marcuse-Kubitza

sql_io.py: put_table(): is_function: Calling function on input rows: Convert PL/Python exceptions (internal_errors) to data_exceptions using sql_gen.plpythonu_error_handler and an error handling wrapper function

3498 07/19/2012 09:10 PM Aaron Marcuse-Kubitza

debug2redmine.csv: EXPLAIN comments: Fixed bug where needed to also match whitespace at beginning of line (indent)

3497 07/19/2012 09:07 PM Aaron Marcuse-Kubitza

Use sql_gen.ReturnQuery where RETURN QUERY was previously manually prepended

3496 07/19/2012 09:05 PM Aaron Marcuse-Kubitza

sql_gen.py: Added ReturnQuery

3495 07/19/2012 08:48 PM Aaron Marcuse-Kubitza

sql.py: define_func(): Fixed bug where next_version() needed to have module name removed since it's in the same module

3494 07/19/2012 08:47 PM Aaron Marcuse-Kubitza

sql.py: mk_select(): Added explain param to turn off automatically running EXPLAIN on the created query. This is useful for SELECT statements which use local variables in PL/pgSQL functions.

3493 07/19/2012 08:44 PM Aaron Marcuse-Kubitza

sql_gen.py: with_table(): Only set the table if the passed-in value is a Col or FunctionCall

3492 07/19/2012 08:41 PM Aaron Marcuse-Kubitza

sql_gen.py: Added Tuple

3491 07/19/2012 08:41 PM Aaron Marcuse-Kubitza

sql_gen.py: Added List and use it in Values.to_str()

3490 07/19/2012 08:14 PM Aaron Marcuse-Kubitza

sql.py: Added define_func()

3489 07/19/2012 07:07 PM Aaron Marcuse-Kubitza

Use sql_gen.SetOf where SETOF was previously manually prepended

3488 07/19/2012 07:06 PM Aaron Marcuse-Kubitza

sql_gen.py: Added SetOf

3487 07/19/2012 07:06 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionDef: Support return_types which are Code objects

3486 07/19/2012 06:55 PM Aaron Marcuse-Kubitza

Use sql_gen.ColType where %TYPE was previously manually appended

3485 07/19/2012 06:54 PM Aaron Marcuse-Kubitza

sql_gen.py: Added ColType

3484 07/19/2012 06:47 PM Aaron Marcuse-Kubitza

Use sql_gen.RowType where %ROWTYPE was previously manually appended

3483 07/19/2012 06:45 PM Aaron Marcuse-Kubitza

sql_gen.py: Added RowType

3482 07/19/2012 06:45 PM Aaron Marcuse-Kubitza

sql_gen.py: RowExcIgnore: Accept row types which are Code objects

3481 07/19/2012 06:42 PM Aaron Marcuse-Kubitza

sql_gen.py: TypedCol: Accept types which are Code objects

3480 07/19/2012 06:34 PM Aaron Marcuse-Kubitza

sql_io.py: data_exception_handler(): Documented that the invalid value must be in a local variable of type text

3479 07/19/2012 06:33 PM Aaron Marcuse-Kubitza

sql_io.py: data_exception_handler(): Documented that the invalid value must be in a local variable of type text

3478 07/19/2012 06:32 PM Aaron Marcuse-Kubitza

sql_io.py: put_table(): is_function: Creating empty pkeys table so its row type can be used: Don't do this if is_literals because special error handling does not apply to that

3477 07/19/2012 06:13 PM Aaron Marcuse-Kubitza

sql_io.py: put_table(): is_function: Create empty pkeys table before calling function on all rows so its row type can later be used in an error handling wrapper function

3476 07/19/2012 05:33 PM Aaron Marcuse-Kubitza

input.Makefile: Staging tables: import/install-%: Run csv2db with a nice increment of +5 to avoid interfering with the user's other processes

3475 07/19/2012 05:28 PM Aaron Marcuse-Kubitza

root map: Run bin/map with a nice increment of +5 to avoid interfering with the user's other processes

3474 07/19/2012 05:24 PM Aaron Marcuse-Kubitza

sql_io.py: put_table(): Handle psycopg2.extensions.TransactionRollbackError by retrying the last query

3473 07/19/2012 05:00 PM Aaron Marcuse-Kubitza

sql_io.py: Creating an empty output pkeys table: Assert that there are no join columns, so that the input pkeys table will be created correctly for the empty output pkeys table

3472 07/19/2012 04:53 PM Aaron Marcuse-Kubitza

sql_io.py: put_table(): Creating an empty output pkeys table: Added "output" to clarify that the created table contains just the output pkeys, and must be joined with the input pkeys table

3471 07/19/2012 04:39 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionDef: Renamed args to params

3470 07/19/2012 04:35 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionDef: Accept parameters as FunctionParam objects instead of strings

3469 07/19/2012 04:32 PM Aaron Marcuse-Kubitza

sql_gen.py: Added FunctionParam

3468 07/19/2012 04:04 PM Aaron Marcuse-Kubitza

sql_gen.py: Added plpythonu_error_handler

3467 07/18/2012 11:06 PM Aaron Marcuse-Kubitza

Autogenerated SQL code: Use new strings.indent() where needed

3466 07/18/2012 11:05 PM Aaron Marcuse-Kubitza

strings.py: Added indent()

3465 07/18/2012 10:50 PM Aaron Marcuse-Kubitza

sql_io.py: data_exception_handler(): Refactored to use sql_gen.RowExcIgnore

3464 07/18/2012 10:31 PM Aaron Marcuse-Kubitza

sql_io.py: cast(): Refactored to use sql_gen.FunctionDef

3463 07/18/2012 10:28 PM Aaron Marcuse-Kubitza

sql_gen.py: ExcHandler: Removed extra newline after handler

3462 07/18/2012 10:27 PM Aaron Marcuse-Kubitza

sql.py: mk_insert_select(): ignore: RETURN QUERY statement: Added back missing newline after ';'

3461 07/18/2012 10:23 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionDef: Added support for parameters

3460 07/18/2012 10:03 PM Aaron Marcuse-Kubitza

sql_io.py: cast(): Just use the first word of the type in the function name to help avoid name collisions. Note that type name collisions that may be introduced by this change are not a problem because the function name is versioned. (The caching mechanism prevents versioning when the function has the same name and definition as an already-defined function.)

3459 07/18/2012 09:59 PM Aaron Marcuse-Kubitza

sql_io.py: Added data_exception_handler() and use it in cast()

3458 07/18/2012 09:58 PM Aaron Marcuse-Kubitza

sql_gen.py: ExcHandler.to_str(): Removed extra newline after body

3457 07/18/2012 08:41 PM Aaron Marcuse-Kubitza

sql_gen.py: ExcHandler: Added repr() since it's not a Code object

3456 07/18/2012 08:17 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionDef: Support custom function modifiers

3455 07/18/2012 08:04 PM Aaron Marcuse-Kubitza

sql_gen.py: RowExcIgnore: Changed exc param to exc_handler to allow user to specify handler code for the exception

3454 07/18/2012 08:01 PM Aaron Marcuse-Kubitza

sql_gen.py: Added ExcHandler, unique_violation_handler

3453 07/18/2012 07:53 PM Aaron Marcuse-Kubitza

sql_gen.py: RowExcIgnore: Don't automatically add 'RETURN QUERY' before the with_row code or ';' after it

3452 07/18/2012 07:02 PM Aaron Marcuse-Kubitza

sql_gen.py: RowExcIgnore: Allow user to specify a custom row var name

3451 07/18/2012 06:55 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionDef: Don't automatically add 'SETOF ' before the return type

3450 07/18/2012 06:44 PM Aaron Marcuse-Kubitza

sql.py: mk_insert_select(): embeddable: Use new sql_gen.RowExcIgnore

3449 07/18/2012 06:44 PM Aaron Marcuse-Kubitza

sql_gen.py: Added RowExcIgnore

3448 07/18/2012 06:12 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionDef: Determine the lang from the body's Code object instead of receiving it as a parameter

3447 07/18/2012 06:10 PM Aaron Marcuse-Kubitza

sql_gen.py: as_Code(): Fixed bug where needed to handle inputs that are already Code objects

3446 07/18/2012 05:52 PM Aaron Marcuse-Kubitza

sql_gen.py: Code: Added lang instance var

3445 07/18/2012 05:49 PM Aaron Marcuse-Kubitza

sql_gen.py: Fixed bug where Code subclasses needed to call Code.__init__() in their init() function. BasicObject: Fixed bug where init() expected a value param, when in fact the value param is something added by certain subclasses.

3444 07/18/2012 05:31 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionDef: body param: Support Code inputs in addition to strings

3443 07/18/2012 05:14 PM Aaron Marcuse-Kubitza

sql.py: mk_insert_select(): embeddable: Use new sql_gen.FunctionDef

3442 07/18/2012 05:13 PM Aaron Marcuse-Kubitza

sql_gen.py: Added FunctionDef

3441 07/18/2012 03:49 PM Aaron Marcuse-Kubitza

README.TXT: Schema changes: Documented how to reinstall errors tables

3440 07/18/2012 03:46 PM Aaron Marcuse-Kubitza

csv2db: Creating errors table: Only drop existing errors table in errors_table_only mode, so that errors tables are not unintentionally deleted when `make inputs/install` is run. This helps to make `make install` idempotent.

3439 07/18/2012 03:40 PM Aaron Marcuse-Kubitza

README.TXT: Maintenance: Full DB: Changed commands to autorotate the created backup and then test and restore a rotated backup

3438 07/18/2012 03:31 PM Aaron Marcuse-Kubitza

backups/Makefile: Added %.backup/rotate

3437 07/18/2012 02:58 PM Aaron Marcuse-Kubitza

backups/Makefile: Rearranged sections so that backup targets, which apply to both Archived imports and Full DB, are at the top of a common Backups section

3436 07/18/2012 02:54 PM Aaron Marcuse-Kubitza

inputs/import.stats.xls: Updated with stats from latest import

3435 07/17/2012 11:09 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Disabled _date() because it does not yet output errors in a format parsable by the import process, and the import process does not yet trap errors produced by SQL functions

3434 07/17/2012 11:00 PM Aaron Marcuse-Kubitza

sql_io.py: put_table(): Determining if can use optimization for only literal values: Fixed bug where needed initial value for reduce()

3433 07/17/2012 10:52 PM Aaron Marcuse-Kubitza

sql_io.py: put_table(): Needing >= one column for INSERT SELECT: Fixed bug where can't add pkey column if calling a function instead of outputting to a table

3432 07/17/2012 10:36 PM Aaron Marcuse-Kubitza

sql_io.py: put_table(): Optimization for only literal values: Also support an empty in_tables list, for use by put()

3431 07/17/2012 10:20 PM Aaron Marcuse-Kubitza

sql_io.py: put_table(): Added optimization for only literal values, which does the same operations as put() but with the additional error handling of put_table()

3430 07/17/2012 10:17 PM Aaron Marcuse-Kubitza

pg_dump_vegbien: Don't use SET SESSION AUTHORIZATION because it doesn't work with the py_functions schema (it requires PL/Python functions to be created as user postgres and then the owner changed to bien, which SET SESSION AUTHORIZATION won't do)

3429 07/17/2012 08:53 PM Aaron Marcuse-Kubitza

sql_gen.py: Added is_literal() and use it where isinstance(..., Literal) is used

3428 07/17/2012 08:44 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Divide fields into input columns and literal values: Translate values: Allow literal values other than strings or None (from the XML parsing), because sql_io.put_table() is getting an optimization for iterations containing only literal values, which just returns the pkey of the single row for these values (which is usually an integer) instead of a temp table with the same value in each row

3427 07/17/2012 08:28 PM Aaron Marcuse-Kubitza

bin/map: by_col: Stripping XML functions not in the DB: Remove DB functions based on whether a plain SQL function of that name exists, rather than whether a relational function (i.e. a table) of that name exists. This will allow column-based import to use plain SQL functions that don't have a corresponding relational function.

3426 07/17/2012 08:23 PM Aaron Marcuse-Kubitza

db_xml.py: Don't remove any explicit pkey because the output table may be a SQL function, which does not have a pkey. This feature only existed to support importing VegBank XML exports, which we don't use (and which would be incompatible with the schema anyway).

3425 07/17/2012 08:19 PM Aaron Marcuse-Kubitza

sql.py: function_exists(): Fixed bug where select() needed to be run with auto-rollback in case it raised an exception

3424 07/17/2012 08:08 PM Aaron Marcuse-Kubitza

xml_func.py: process(): Changed rel_funcs param to a callback is_rel_func, so that caller can specify any dynamic function to determine if a name is a relational function rather than having to list out all known relational functions

3423 07/17/2012 07:54 PM Aaron Marcuse-Kubitza

sql.py: function_exists(): Use simpler cast to regproc instead of query of information_schema.routines to determine if function exists. When the schema is not specified, this also limits the schemas checked to the search_path instead of the whole DB.