Project

General

Profile

# Date Author Comment
12484 02/25/2014 10:48 PM Aaron Marcuse-Kubitza

schemas/util.sql, vegbien.sql: use util.use_own_schema()/util.set_search_path() instead of EXECUTE util.mk_use_own_schema()/util.mk_set_search_path()

12441 02/25/2014 11:37 AM Aaron Marcuse-Kubitza

schemas/util.sql, vegbien.sql: do not declare IMMUTABLE SQL-language functions as STRICT, because this prevents them from being inlined (as documented in the util schema comment)

12435 02/25/2014 10:29 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: synced from DB, which changes the order of the ~type tables

12425 02/25/2014 07:52 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: _plots_04_count_of_plots_in_each_project_in_this_source: added operator %== to match the rows by project_name

12424 02/25/2014 07:42 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: diff(text, text) and types that use its custom FULL JOIN matching: need to use separate operator %== for determining which records to put on the same row, so that the = filter for identical rows only excludes rows that are actually the same, not all rows with the same keys (which would usually remove all rows)

12422 02/25/2014 07:14 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: synced from DB, which changes the order of the ~type tables

12421 02/25/2014 12:24 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: _plots_02_list_of_project_names: added = operator that causes FULL JOIN to only use some columns, so that rows for the same label column are put on the same row in the diff table

12418 02/24/2014 11:17 PM Aaron Marcuse-Kubitza

fix: inputs/SALVIAS/validations.sql: _plots_02_list_of_project_names: altered column aliases to match output query

12416 02/24/2014 05:16 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: rm_query_group(): schemas/vegbien.sql: util.drop_relations_like(): also need to drop ~type tables, so that they will be re-created for the new queries of that group

12415 02/24/2014 04:52 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added rm_query_group(), which removes all validations queries with a particular group prefix

12414 02/24/2014 04:50 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: generated ~type for _plots_04_count_of_plots_in_each_project_in_this_source

12412 02/24/2014 03:26 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: public_validations._plots_* that use projectname: re-alias to project_name to match input queries. (reexporting apparently changes the relative order of the ~type tables.)

12411 02/24/2014 02:34 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: _plots_03_count_of_all_plots_in_this_source: use top_plot instead of location because the corresponding input query includes just the top-level plots

12410 02/24/2014 02:33 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added ~type tables for plots queries that are able to be run successfully

12399 02/24/2014 12:24 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: synced to DB, which changes the sort order (due to system update?)

12390 02/23/2014 07:44 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: public_validations.rename_query_view(): fixed usage

12389 02/23/2014 07:43 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added remake_diff_tables() with no args, which remakes all validatable datasources

12388 02/23/2014 07:40 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added validatable_datasources()

12387 02/23/2014 07:36 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added validatable_datasources()

12386 02/23/2014 07:31 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: validation_views(): allow leaving out schema to match all datasources

12385 02/23/2014 07:23 PM Aaron Marcuse-Kubitza

schemas/util.sql: show_views_like(): take a schema regexp like util.show_relations_like(), to allow matching views in all schemas

12383 02/23/2014 07:01 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validations.remake_diff_table(): put the type table in the public_validations schema to avoid cluttering up the datasource schema with internal tables

12379 02/23/2014 05:32 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validations.remake_diff_table(in_view regclass): document how to regenerate the diff table, in a place that's readily available to someone using the table

12367 02/23/2014 12:13 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: _traits_08_taxonname_trait_and_value_for_first_5000_records: renamed to _traits_08_taxonname_trait_and_value because this actually includes all the records, not just the first 5000. this uses the new public_validations.rename_query_view() to rename all associated tables and views, including handling truncated names.

12366 02/23/2014 12:08 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: query_relations(), new_query_view_relation_name(): need to take into account the prefix when determining truncation, using the max_prefix_len param

12365 02/23/2014 12:04 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added query_view_relation_max_prefix_len()

12352 02/22/2014 07:18 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added rename_query_view(), which renames all DB objects related to a particular validations query

12351 02/22/2014 07:13 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added new_query_view_relation_name()

12338 02/22/2014 04:04 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added rm_query_view(), which removes all DB objects related to a particular validations query

12337 02/22/2014 03:49 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: remake_diff_tables(): need to set function option search_path in order to limit the effects of `SET LOCAL search_path` (mk_set_search_path()) to the current function

12336 02/22/2014 03:48 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: query_views(): renamed to query_relations() because this also returns non-views

12335 02/22/2014 03:35 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added public_validations.query_views()

12326 02/22/2014 02:03 PM Aaron Marcuse-Kubitza

schemas/util.sql: show_views_like(): reversed argument order to match show_relations_like()

12323 02/21/2014 10:19 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: remake_diff_tables(): updated runtime now that row limit has been removed (same, 45 min)

12322 02/20/2014 07:18 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: _traits_07_trait_value_and_units, _traits_08_taxonname_trait_and_value_for_first_5000_records: removed LIMIT to match the input queries

12319 02/20/2014 06:49 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: remake_diff_tables(): updated bien2_traits runtime (45 min) to include the now-properly-renamed views 6-8

12318 02/20/2014 06:14 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: remake_diff_tables(): documented runtime for bien2_traits (30 min)

12317 02/20/2014 05:52 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: renamed output views to match input views

12316 02/20/2014 04:52 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: _traits_01_count_records (output side): documented runtime (4 min)

12315 02/20/2014 04:33 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: source_by_shortname(): resolved ambiguous column references by renaming PL/pgSQL vars and adding table qualifiers

12314 02/20/2014 04:28 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: source_by_shortname(): changed from STABLE to VOLATILE because the search_path can only be set in VOLATILE functions

12313 02/20/2014 04:19 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: source_by_shortname(): can't be declared STRICT because it now has a 2nd param (schema_anchor) which is always NULL

12312 02/20/2014 08:42 AM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: remake_diff_tables(): can't raise exception at end if had errors, because this would roll back the transaction. instead use new util.raise_error_notice().

12309 02/18/2014 07:16 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added remake_diff_tables()

12307 02/17/2014 09:06 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added validation_views()

12295 02/17/2014 04:08 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: remake_diff_table(): prepend ~ to the type table so that it sorts at the end, away from the main tables

12294 02/17/2014 03:56 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: remake_diff_table(): can't have in_table/out_table inherit from each other, because inheritance also causes the rows of the parent table to be included in the child table. instead, they need to inherit from a common, empty table, as implemented by the new util.remake_diff_table().

12287 02/17/2014 02:06 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added remake_diff_table()

12274 02/17/2014 11:25 AM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: setting search_path locally: also need to set function option search_path, in order to limit the effects of `SET LOCAL search_path` (mk_set_search_path()) to the current function (http://www.postgresql.org/docs/9.1/static/sql-set.html#AEN75423)

12273 02/17/2014 11:14 AM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: setting search_path locally: need to use `SET LOCAL search_path TO` instead of `PERFORM set_config(search_path, ..., is_local := true)` because the meaning of is_local refers to the entire transaction, not just the current function (as for LOCAL)

12264 02/16/2014 11:59 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added rematerialize_in_view()

12263 02/16/2014 11:16 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: rematerialize_out_view(): pass a schema-qualified name to util.rematerialize_view() to avoid depending on the search_path to create it in the right schema

12262 02/16/2014 11:08 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: materialize_query(): support schema-qualified tables. this requires escaping tables in calls to this function.

12261 02/16/2014 10:52 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added rematerialize_out_view(in_view regclass)

12259 02/16/2014 09:47 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added rematerialize_out_view(datasource_schema text, out_view regclass)

12258 02/16/2014 09:39 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: source_by_shortname(): added schema_anchor so that it always applies to the schema it's defined in, even if `public` is not in the search_path

12257 02/16/2014 09:20 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: functions with schema_anchors: documented that they must use LANGUAGE plpgsql because LANGUAGE sql does not support runtime changes of search_path (schema elements are bound at inline time rather than runtime)

12256 02/16/2014 09:14 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: functions with schema_anchors: must use plpgsql for these because the sql language does not support runtime changes of search_path (the schema elements they use are bound at inline time rather than runtime)

12255 02/16/2014 08:55 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: schema_null param: renamed to schema_anchor to clarify what this is for

12254 02/16/2014 08:52 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: schema_null: clarified that this should always be left as the default value, not just usually

12253 02/16/2014 08:49 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: schema_null params: use schema_anchor instead of source for this, since it is guaranteed to exist regardless of which tables are in the VegBIEN schema

12252 02/16/2014 08:46 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public: added schema_anchor (used with schema_null params)

12248 02/16/2014 05:56 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: removed no longer used concat() aggregate. use builtin string_agg() instead.

12238 02/16/2014 06:45 AM Aaron Marcuse-Kubitza

schemas/util.sql: schema_ident(): renamed to schema_esc() for clarity

12237 02/16/2014 06:42 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added schema_anchor, for use with schema_null params

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)

12224 02/14/2014 03:09 PM Aaron Marcuse-Kubitza

validation/aggregating/*/*.sql, schemas/vegbien.sql, lib/runscripts/validations.pg.sql.run, inputs/bien2_traits/validations.sql: added _ to beginning of each view name so the validation views would sort at the top in the datasource's tables list. this will also make the validation result sets easily distinguishable from the data tables.

12186 02/13/2014 04:06 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validations_*: merged into single public_validations schema, with type-specific prefixes for each query, so that datasources can use validations queries from multiple type categories, and so that each datasource doesn't have to indicate which validations output schema it's using

12183 02/13/2014 02:09 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: regenerated from DB, which adds an autogenerated column alias

12172 02/13/2014 10:41 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql, validation/aggregating/*/*.sql: renamed public_validation_* to plural public_validations_* since we refer to them as aggregating validation*s*

12169 02/13/2014 08:34 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validation_plots: added Brad's notes as comments

12168 02/13/2014 08:29 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validation_plots: populated queries from validation/aggregating/plots/bien3_validations_salvias_vegbien.sql

12165 02/13/2014 08:20 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validation_traits: added Brad's notes as comments

12164 02/13/2014 08:17 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validation_traits: populated queries from validation/aggregating/traits/bien3_validations_traits_bien3.sql

12156 02/13/2014 05:58 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: analytical_stem.datasource: removed fkey to source.shortname because this prevents individually-reloaded datasources from being published

12155 02/13/2014 05:56 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: publish(), rm(): documented runtime (1 min)

12154 02/13/2014 05:49 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added datasource_unpublish()

12147 02/08/2014 10:38 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validation: split into separate subschemas for plots, specimens, traits

12144 02/08/2014 10:00 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: public_validation comment: undid incorrect replacement of "validation" with "public_validation"

12138 02/08/2014 03:55 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added rm(), which deletes this schema

12137 02/08/2014 03:17 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added publish(), which publishes this schema

12136 02/08/2014 02:47 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added public_schema_publish()

12131 02/07/2014 08:30 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: datasource_publish(): removed nested transaction, which is not needed because Postgres runs each top-level command in a transaction (including in autocommit mode)

12130 02/07/2014 06:58 PM Aaron Marcuse-Kubitza

bugfix: schemas/Makefile,vegbien.sql: renamed validation to public_validation to match the suffixed name applied by `make schemas/public/install`

12042 02/05/2014 01:02 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added validation schema, which contains queries used in the aggregating validations. schemas/Makefile: include schemas that depend on `public` (eg. `validation`) so they are restored along with it.

12024 02/02/2014 07:52 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added top_plot view

12015 01/28/2014 05:02 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: location_set_top_plot(): only do the lookup of the parent's top_plot when there is a parent_id

12014 01/28/2014 04:56 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: location: added autopopulated top_plot

12013 01/26/2014 11:09 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: locationevent: added locationevent_pull_forward_from_parent() trigger which populates project_id from the parent locationevent

12010 01/25/2014 11:17 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: locationevent__pull_forward_from_parent(): renamed to locationevent_pull_forward_from_parent_for_stratum() since it actually has a filter that causes it to apply only to stratum events

12006 01/23/2014 11:21 AM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: commconcept: added missing unique constraint on commdescription, which is also an identifying field in addition to the ID (which is in commname.commname)

11998 01/23/2014 12:15 AM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: locationevent__communities(): inner-join to commdetermination instead of left-joining, so that this does not produce community entries (which occur because there is one commclass per locationevent, but only some commclasses will then have a commdetermination)

11990 01/22/2014 12:24 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: projectcontributor: added missing unique constraint

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).

11963 01/15/2014 11:23 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: plot.**, analytical_stem_view, analytical_plot: added project_contributors

11962 01/15/2014 11:14 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added project_contributors()

11921 12/19/2013 11:11 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: analytical_stem_view: scientificName_verbatim: don't use taxonverbatim.taxonname+author as the scientificName_verbatim if only the author is provided. (this lead to weird scientificName_verbatims that contain just the author.)

11908 12/12/2013 08:35 AM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: location: use the place_id from the parent location when no place_id is specified. this fixes a bug in analytical_stem_view where the parent location's place_id was used because it was sometimes missing from the sublocation, but the parent place_id itself was sometimes missing instead if sublocations each had their own place information. this way, it is always available directly in the sublocation, populated from the parent location if needed.

11907 12/12/2013 08:27 AM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: location: added place_id which is autopopulated from the current locationplace. join on this in plot.**, to avoid a 1:many join when a location has multiple locationplaces.

11906 12/11/2013 11:10 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: locationevent_unique_within_parent_by_location unique index: need COALESCE around location_id since it's nullable