Project

General

Profile

# Date Author Comment
12235 02/16/2014 02:14 AM Aaron Marcuse-Kubitza

schemas/*.sql: make sure every COMMENT starts and ends on its own line, so that it appears correctly in the formats it's most likely to be read in (ie. in the DDL export, not the COMMENT edit box in pgAdmin)

11970 01/20/2014 11:33 AM Aaron Marcuse-Kubitza

moved everything into /trunk/ to create the standard svn layout, for use with tools that require this (eg. git-svn). IMPORTANT: do NOT do an `svn up`. instead, re-use your working copy's existing files with `svn switch` (http://svnbook.red-bean.com/en/1.6/svn.ref.svn.c.switch.html).

11667 11/14/2013 02:32 PM Aaron Marcuse-Kubitza

schemas/*.sql: updated for PostgreSQL 9.3. this reorders some functions, adds empty comment headers for omitted SEQUENCE SET commands, and (best of all) finally splits view columns onto multiple lines, so that changes in the columns are actually legible (and produce their own svn diff!)

8183 03/27/2013 12:43 PM Aaron Marcuse-Kubitza

schemas/*functions.sql: Renamed to *util.sql because now that these schemas are used by the new-style import scripts, there can be more than just functions in them

7725 02/26/2013 08:27 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Added _date(year integer, month integer, day integer)

7107 01/07/2013 07:15 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: parse_date_range(): Don't parse strings containing a time, because - and ' ' don't have the same meaning as in a date range

6218 11/15/2012 08:30 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _date(): Removed features that require dateutil, which is not available under plpython3u. This includes removing the now-unused date string parameter.

6216 11/15/2012 08:12 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Replaced xrange() with range() for plpython3u

6214 11/15/2012 08:04 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Updated except clause syntax for PostgreSQL 9.1.6

6213 11/15/2012 08:03 PM Aaron Marcuse-Kubitza

schemas/*.sql: Updated for PostgreSQL 9.1.6, which has standard_conforming_strings = on (which affects \-escapes in string literals), escape_string_warning not explicitly set, and uses ALTER TABLE ONLY instead of ALTER TABLE

6204 11/15/2012 06:17 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Changed function languages to plpython3u to match the new installed version. Note that plpythonu is not available on Mac under PostgreSQL 9.1.6.

4983 09/25/2012 06:13 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _namePart(): Fixed bug where it was returning the empty string instead of NULL

4982 09/25/2012 05:57 PM Aaron Marcuse-Kubitza

schemas/functions.sql, py_functions.sql: Added schema comment that functions must always return NULL in place of the empty string, to ensure that empty strings do not find their way into VegBIEN. Note that row-based import automatically removes empty strings because the intermediate values are stored in XML and our XML DOM traversing code auto-replaces the empty string with NULL. Column-based import, on the other hand, does not, because the intermediate data is stored in database temp tables instead of a DOM tree.

4948 09/24/2012 02:36 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _namePart(): Slice the first name from the beginning of the string to one word before the end, instead of one after the beginning, in order to avoid overlap with the last name, which starts one before the end, when there is only one word. Note that only one word means the name is assumed to be a last name. This assumption may not always be true, but when a datasource provides the name concatenated, an assumption must be made when not all name components are present.

4549 09/10/2012 10:21 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Added pass-through _date(timestamp) for datasource date columns that are already timestamps

4542 09/10/2012 09:25 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Added pass-through _dateRangeStart(timestamp), _dateRangeEnd(timestamp) for datasource date columns that are already timestamps

4019 08/15/2012 02:05 AM Aaron Marcuse-Kubitza

schemas/py_functions.sql: parse_date_range(): Always return a value for end date, even if string is not a date range. This enables using _dateRangeEnd() as a filter function on anything intended as an end date.

3695 07/31/2012 07:57 PM Aaron Marcuse-Kubitza

schemas/functions.sql, py_functions.sql: Removed no longer needed relational functions, since sql_io.put_table() supports regular SQL functions

3634 07/27/2012 04:35 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _dateRange*(): Made functions STRICT because they return NULL on NULL input

3597 07/24/2012 09:35 AM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _date(): YMD parsing: Fixed bug where exception for ValueError needed to be stored in local var so its message could be parsed

3553 07/23/2012 10:21 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _date(): Raise (or pass through) ValueErrors directly instead of wrapping them in FormatExceptions, to simplify the code. This will also enable later translation of ValueErrors to data_exceptions. When year is required and missing, output a parsable 'null value in column year violates not-null constraint' error.

3541 07/20/2012 07:10 AM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _date(): Re-enabled now that exceptions thrown are properly handled. FormatException: Support raising parsable data_exceptions when provided with the value that was invalid. Date parsing mode: Return date as the value in FormatException so it can be filtered out automatically by column-based 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

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)

3422 07/17/2012 07:51 PM Aaron Marcuse-Kubitza

schemas/functions.sql, py_functions.sql: Renamed trigger functions to avoid collisions with plain SQL functions of the same name but different signatures, so that the plain SQL functions can be uniquely identified by their name without also requiring their signature

3416 07/17/2012 06:24 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _date(): Just run str() on the returned datetime because it will usually be converted to a PostgreSQL timestamp anyway, so excluding the time from the string isn't necessary

3415 07/17/2012 06:15 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Added _date()

3396 07/16/2012 05:03 PM Aaron Marcuse-Kubitza

pg_dump_vegbien: Use SET SESSION AUTHORIZATION to ensure that owners are always recorded in the same format. This will help make plain text backups comparable using diff.

3278 07/09/2012 04:32 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Removed per-column indexes on relational functions, which are no longer needed by row-based import because it is able to do a merge join-style lookup using the table's UNIQUE INDEX. (Note that column-based import doesn't use the (slower) relational functions at all anymore, and instead calls the corresponding SQL function directly using named arguments.)

2952 06/19/2012 10:11 AM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Added plain function _namePart() and use it in trigger function _namePart()

2951 06/19/2012 09:42 AM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Added plain functions _dateRangeStart() and _dateRangeEnd() and use them in trigger functions _dateRangeStart() and _dateRangeEnd()

2867 06/14/2012 10:22 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _dateRangeStart, _dateRangeEnd: Changed indexes to use `COALESCE` to match what sql_gen now does

2866 06/14/2012 10:19 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _namePart: Changed indexes to use `COALESCE` to match what sql_gen now does

2636 06/05/2012 03:17 PM Aaron Marcuse-Kubitza

schemas/functions.sql: Added indexes on all relational function parameters since the unique index will not be used for lookups

2635 06/05/2012 02:29 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Added _namePart relational function

2634 06/05/2012 01:06 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Added _dateRangeEnd relational function

2632 06/05/2012 12:55 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _dateRangeStart(): Fixed bug where needed to get the first element of the array returned by parse_date_range()

2630 06/05/2012 11:52 AM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Added _dateRangeStart relational function

2623 06/05/2012 10:16 AM Aaron Marcuse-Kubitza

schemas/py_functions.sql.make: Fixed bug where owners needed to be included because schema is imported as superuser so that untrusted PL/Python functions can be created

2620 06/05/2012 09:52 AM Aaron Marcuse-Kubitza

schemas/Makefile, py_functions.sql.make: Generate py_functions.sql from vegbien's py_functions schema