Project

General

Profile

# Date Author Comment
13815 06/18/2014 08:38 PM Aaron Marcuse-Kubitza

schemas/util.sql: added lat_long_in_new_world()

13814 06/18/2014 08:35 PM Aaron Marcuse-Kubitza

schemas/util.sql: added operator @(postgis.geography, postgis.geography). can't use && for this because it only compares 2D bounding boxes (which are geometry objects that do not support geocoordinate wraparound).

13813 06/18/2014 08:06 PM Aaron Marcuse-Kubitza

schemas/util.sql: added point()

13812 06/18/2014 08:00 PM Aaron Marcuse-Kubitza

schemas/util.sql: new_world(): removed no longer needed cast to postgis.geography

13811 06/18/2014 07:59 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: bounding_box(): must use postgis.geography (instead of postgis.geometry) because that handles geocoordinate wraparound correctly

13810 06/18/2014 07:52 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: bounding_box(): need to explicitly set SRID to make sure the correct value is used

13809 06/18/2014 07:39 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: bounding_box(): use st_makeenvelope() instead of st_makebox2d() because st_makebox2d() doesn't support geocoordinate wraparound (it is not SRID-aware)

13808 06/18/2014 07:32 PM Aaron Marcuse-Kubitza

schemas/util.sql: new_world(): removed no longer needed cast to postgis.geometry

13807 06/18/2014 07:31 PM Aaron Marcuse-Kubitza

schemas/util.sql: bounding_box(): return postgis.geometry instead of postgis.box2d because box2d is not directly used in postgis functions

13805 06/18/2014 04:43 PM Aaron Marcuse-Kubitza

schemas/util.sql: added new_world()

13804 06/18/2014 04:30 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: bounding_box(): use util.range instead of numrange to support wraparound ranges for geocoordinates

13803 06/18/2014 04:26 PM Aaron Marcuse-Kubitza

schemas/util.sql: range(numeric, numeric): use util.range instead of numrange to support wraparound ranges (which use a modulus system such as geocoordinates)

13802 06/18/2014 04:20 PM Aaron Marcuse-Kubitza

schemas/util.sql: added `range` type (and cast to numrange), which allows wraparound ranges such as for geocoordinates

13801 06/18/2014 03:56 PM Aaron Marcuse-Kubitza

schemas/util.sql: bounding_box(): documented usage

13799 06/18/2014 03:52 PM Aaron Marcuse-Kubitza

schemas/util.sql: added bounding_box()

13795 06/17/2014 04:48 PM Aaron Marcuse-Kubitza

schemas/util.sql: range(numeric, numeric): use simpler numrange() constructor instead of text input syntax

13794 06/17/2014 04:39 PM Aaron Marcuse-Kubitza

schemas/util.sql: operator functions: renamed to plain-text names to follow the Postgres convention of making the function name be the human-readable name of the operator

13790 06/16/2014 06:50 PM Aaron Marcuse-Kubitza

schemas/util.sql: added ~ operator for ranges

13645 06/05/2014 07:15 AM Aaron Marcuse-Kubitza

fix: schemas/util.sql: view_def_to_orig(): also need to merge .* expressions resulting from a SELECT * of a join, to avoid duplicated columns

13644 06/05/2014 06:52 AM Aaron Marcuse-Kubitza

fix: schemas/util.sql: view_def_to_orig(): require at least 6 cols to avoid false positives in the expansion match pattern

13643 06/05/2014 06:49 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: view_def_to_orig(): 1st col: can't prepend \y because it considers only \w chars, not "

13642 06/05/2014 06:35 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: view_def_to_orig(): don't match whitespace in the middle of a "" identifier, as this could throw off the parser

13641 06/05/2014 06:34 AM Aaron Marcuse-Kubitza

schemas/util.sql: eval(): restore user's intent by running util.view_def_to_orig() on the query to unexpand expanded * expressions

13640 06/05/2014 05:50 AM Aaron Marcuse-Kubitza

schemas/util.sql: pg_get_viewdef(): use util.view_def_to_orig()

13639 06/05/2014 05:50 AM Aaron Marcuse-Kubitza

schemas/util.sql: added view_def_to_orig()

13638 06/05/2014 05:46 AM Aaron Marcuse-Kubitza

fix: schemas/util.sql: pg_get_viewdef(): should be STABLE because it references system catalogs

13637 06/05/2014 05:44 AM Aaron Marcuse-Kubitza

schemas/util.sql: added pg_get_viewdef() wrapper, which unexpands expanded * expressions

13608 06/03/2014 10:25 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: mk_drop_from_create(): need to match first rather than last CREATE

13606 06/03/2014 09:52 AM Aaron Marcuse-Kubitza

schemas/util.sql: recreate_view(): support omitting the view_query if the view has already been modified (eg. for public.*_view, which allow changing the view as a separate step)

13604 06/03/2014 08:52 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: recreate(): need to handle case where util.mk_drop_from_create() is NULL

13603 06/03/2014 08:45 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: mk_drop_from_create(): only match CREATE if no custom DROP came before it

13601 06/03/2014 08:19 AM Aaron Marcuse-Kubitza

fix: schemas/util.sql: explain2notice_msg_if_can(): also need to catch invalid_cursor_definition ("cannot open multi-query plan as cursor")

13599 06/03/2014 07:39 AM Aaron Marcuse-Kubitza

schemas/util.sql: added copy()

13598 06/03/2014 07:36 AM Aaron Marcuse-Kubitza

schemas/util.sql: added copy_data()

13566 05/30/2014 06:22 PM Aaron Marcuse-Kubitza

schemas/util.sql: added seq__reset()

13565 05/30/2014 06:15 PM Aaron Marcuse-Kubitza

schemas/util.sql: added seq__create()

13564 05/30/2014 06:11 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: try_cast(), is_castable(): also catch invalid_schema_name, thrown by `'pg_temp.__'::regclass`

13535 05/27/2014 03:21 AM Aaron Marcuse-Kubitza

fix: schemas/util.sql: mk_drop_from_create(): also support CREATE queries that include the SELECT statement on the same line as the CREATE

13529 05/26/2014 11:41 PM Aaron Marcuse-Kubitza

schemas/util.sql: create_if_not_exists(): print message if already exists, so the function doesn't inexplicably appear not to have run at all

13525 05/23/2014 06:09 PM Aaron Marcuse-Kubitza

schemas/util.sql: added recreate_view(), a special case of util.recreate()

13524 05/23/2014 04:24 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: recreate(): usage: use `schema` instead of `schemas`

13517 05/21/2014 07:30 PM Aaron Marcuse-Kubitza

schemas/util.sql: recreate(): perform the correct DROP VIEW in the function itself so that the caller does not have to worry about forming it properly

13516 05/21/2014 07:19 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: mk_drop_from_create(): added `DROP`

13515 05/21/2014 07:18 PM Aaron Marcuse-Kubitza

schemas/util.sql: added mk_drop_from_create()

13514 05/21/2014 06:52 PM Aaron Marcuse-Kubitza

schemas/util.sql: added regexp_match()

13512 05/21/2014 05:50 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: force_recreate(): renamed to just recreate(), because "force" normally implies that things will be deleted, which this function does not do

13505 05/21/2014 03:44 PM Aaron Marcuse-Kubitza

schemas/util.sql: show_create_view(): use new mk_set_relation_metadata()

13504 05/21/2014 03:41 PM Aaron Marcuse-Kubitza

schemas/util.sql: added mk_set_relation_metadata()

13499 05/21/2014 12:59 AM Aaron Marcuse-Kubitza

schemas/util.sql: force_recreate(): documented usage, which is somewhat complex and has several important parts

13497 05/20/2014 05:40 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: restore_views(): need to specify view name for a manual existence check, in case the view definition becomes invalid, which would produce a nonstandard (uncatchable) exception

13496 05/20/2014 05:33 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: explain(): don't display any log messages printed by IMMUTABLE functions in the query, which EXPLAIN apparently runs

13495 05/20/2014 05:21 PM Aaron Marcuse-Kubitza

schemas/util.sql: create_if_not_exists(): added relation param, which can be used to ensure that a standard exception is always generated if the relation exists, even if the table definition would be invalid (which generates a variety of exceptions)

13493 05/19/2014 09:08 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: try_cast(), is_castable(): also need to handle syntax_error_or_access_rule_violation, which is thrown by ::regclass

13492 05/19/2014 08:52 PM Aaron Marcuse-Kubitza

schemas/util.sql: added relation_exists()

13491 05/19/2014 08:27 PM Aaron Marcuse-Kubitza

schemas/util.sql: save_drop_views()/restore_views(): store the view path in addition to the definition so it can be used in restoring

13490 05/19/2014 08:24 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: in_reverse(): can't use `SELECT *` for composite types because this expands them

13489 05/19/2014 08:21 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: array_reverse(): can't use `SELECT *` for composite types because this expands them

13488 05/19/2014 07:50 PM Aaron Marcuse-Kubitza

schemas/util.sql: save_drop_views()/restore_views(): use opaque return type so it can be changed without changing the local var type in functions that use this

13487 05/19/2014 07:22 PM Aaron Marcuse-Kubitza

schemas/util.sql: force_recreate(): recreate_users_cmds: renamed to restore_views_info since this is now whatever is needed by util.restore_views()

13486 05/19/2014 07:16 PM Aaron Marcuse-Kubitza

schemas/util.sql: added restore_views() and use it in force_recreate()

13485 05/19/2014 02:07 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: save_drop_views(): views must be dropped in reverse dependency order, but returned in forward dependency order

13484 05/19/2014 01:36 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: force_recreate(): dependent views need to be re-created in forward dependency order. this is done by reversing the dependencies only for save_drop_views().

13483 05/19/2014 12:48 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: mk_set_comment(): need to use VIEW instead of TABLE for views

13482 05/19/2014 12:29 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: show_create_view(): also need to include view comment

13481 05/19/2014 12:24 AM Aaron Marcuse-Kubitza

fix: schemas/util.sql: mk_set_comment(): added ;

13480 05/19/2014 12:20 AM Aaron Marcuse-Kubitza

fix: schemas/util.sql: show_set_comment(): don't display a COMMENT ON statement if no comment, because this will be appended to table defs, etc. and would create clutter

13479 05/19/2014 12:16 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: mk_set_comment(): need to handle NULL comment properly

13478 05/19/2014 12:06 AM Aaron Marcuse-Kubitza

schemas/util.sql: added show_set_comment(regclass)

13477 05/18/2014 11:57 PM Aaron Marcuse-Kubitza

schemas/util.sql: set_comment(): use util.mk_set_comment()

13474 05/17/2014 06:22 PM Aaron Marcuse-Kubitza

schemas/util.sql: added mk_set_comment()

13471 05/17/2014 05:36 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: force_recreate(): recreate_users_cmds: use create_if_not_exists() rather than eval(), because cmd might manually re-create a deleted dependent view, causing it to already exist

13470 05/17/2014 05:27 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: save_drop_view(): util.show_create_view(): don't include `OR REPLACE` because that causes nonuniform errors (eg. invalid_table_definition), instead of the standard duplicate_table exception caught by util.create_if_not_exists()

13469 05/17/2014 05:25 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: show_create_view(): removed extra trailing ; because pg_get_viewdef() now includes one

13468 05/17/2014 05:24 PM Aaron Marcuse-Kubitza

schemas/util.sql: show_create_view(): made inclusion of `OR REPLACE` configurable

13467 05/17/2014 05:10 PM Aaron Marcuse-Kubitza

schemas/util.sql: save_drop_view(): use util.drop_view()

13456 05/13/2014 11:19 AM Aaron Marcuse-Kubitza

schemas/util.sql: save_drop_views(): return text[] instead of concatenated text so that the queries will be run individually and be easier to debug

13455 05/13/2014 11:00 AM Aaron Marcuse-Kubitza

schemas/util.sql: added eval(queries text[])

13454 05/13/2014 09:43 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: force_recreate(): need to drop users in reverse to avoid dependencies that block the drop

13453 05/13/2014 09:25 AM Aaron Marcuse-Kubitza

schemas/util.sql: added array_reverse()

13452 05/13/2014 09:25 AM Aaron Marcuse-Kubitza

schemas/util.sql: added in_reverse()

13451 05/13/2014 08:39 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: force_recreate(): need to use :lower:, not [:lower:]

13450 05/13/2014 08:34 AM Aaron Marcuse-Kubitza

schemas/util.sql: force_recreate(): debug-print PG_EXCEPTION_DETAIL, users to assist in debugging

13449 05/13/2014 08:33 AM Aaron Marcuse-Kubitza

fix: schemas/util.sql: debug_print_value(): added trailing newline to visually distinguish the printed value

13448 05/13/2014 08:27 AM Aaron Marcuse-Kubitza

schemas/util.sql: added debug_print_var()

13447 05/13/2014 07:06 AM Aaron Marcuse-Kubitza

schemas/util.sql: debug_print_return_value(): use new util.debug_print_value()

13446 05/13/2014 06:59 AM Aaron Marcuse-Kubitza

schemas/util.sql: added debug_print_value()

13445 05/13/2014 05:45 AM Aaron Marcuse-Kubitza

fix: schemas/util.sql: util.force_recreate(): also support dropping things besides tables

13403 05/03/2014 03:10 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: explain2notice_msg_if_can(): don't use util.is_explainable() because the list provided by Postgres (http://www.postgresql.org/docs/9.3/static/sql-explain.html#AEN77691) excludes some query types that are in fact EXPLAIN-able

13397 05/03/2014 01:28 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: materialize_query(): contents generated from: need to include search_path so query is runnable

13384 05/02/2014 03:53 PM Aaron Marcuse-Kubitza

schemas/util.sql: added loop_ignore_errors()

13355 04/30/2014 05:32 PM Aaron Marcuse-Kubitza

schemas/util.sql: added _km_to_m() for use when public._km_to_m() is not defined yet

13139 04/15/2014 07:00 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: is_castable(): need to pass NULL through, for proper NULL propagation

13136 04/15/2014 06:12 PM Aaron Marcuse-Kubitza

schemas/util.sql: added is_castable()

13135 04/15/2014 06:10 PM Aaron Marcuse-Kubitza

schemas/util.sql: added try_cast()

13134 04/15/2014 05:51 PM Aaron Marcuse-Kubitza

schemas/util.sql: added util.cast(), which allows casting to an arbitrary type without eval()

13098 04/10/2014 05:26 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: remake_diff_table(): need to rm_freq() type_table, because left/right_table don't have freq yet

13097 04/10/2014 05:18 AM Aaron Marcuse-Kubitza

schemas/util.sql: auto_rm_freq(): use new rm_freq()

13096 04/10/2014 05:17 AM Aaron Marcuse-Kubitza

schemas/util.sql: added rm_freq(regclass[])

13092 04/10/2014 03:10 AM Aaron Marcuse-Kubitza

schemas/util.sql: remake_diff_table(): result table comment: documented how to display NULL values that are extra or missing

12874 03/24/2014 12:45 AM Aaron Marcuse-Kubitza

fix: schemas/util.sql: trim(): by default, cascadingly drop dependent columns so that they don't prevent trim() from succeeding. note that this requires the dependent columns to then be manually re-created.