Project

General

Profile

# Date Author Comment
14452 08/11/2014 02:59 AM Aaron Marcuse-Kubitza

schemas/util.sql: added _concat_nullify(), which uses || instead of concat()

14425 08/09/2014 07:02 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: view_is_subset_or_renaming(): views with CASE statements are also not subsets/renamings

14418 08/08/2014 02:32 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: added GRANT USAGE for bien_read, public_ so that util schema functions can be called by other users

14415 08/04/2014 06:18 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: drop_derived_col(): also need to run util.derived_cols_trigger_update()

14387 07/28/2014 11:58 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: view_def_to_orig(): need to support aliased columns (produced when a column is renamed)

14386 07/28/2014 05:59 PM Aaron Marcuse-Kubitza

schemas/util.sql: added aliased_col_re()

14385 07/28/2014 05:57 PM Aaron Marcuse-Kubitza

schemas/util.sql: added alias_re()

14384 07/28/2014 05:50 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: view_is_subset(): renamed to view_is_subset_or_renaming() because this also supports views that just rename columns, which should not be .*-ed by view_def_to_orig()

14383 07/28/2014 05:33 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: view_def_to_orig(): can't use FROM to alias util.col_re() because that prevents inlining the function

14382 07/28/2014 05:31 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: view_def_to_orig(): can't use FROM to alias util.col_re() because that prevents inlining the function

14381 07/28/2014 05:24 PM Aaron Marcuse-Kubitza

schemas/util.sql: view_def_to_orig(): use util.col_re() for clarity

14380 07/28/2014 05:20 PM Aaron Marcuse-Kubitza

schemas/util.sql: added col_re()

14379 07/28/2014 04:45 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: derived_col_update(): also need steps to drop column, because DROP __ CASCADE doesn't work when there are dependent views

14373 07/27/2014 03:19 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: derived_cols_export(): also need to first run util.derived_cols_remove() if changing the derived column order

14372 07/27/2014 03:15 PM Aaron Marcuse-Kubitza

schemas/util.sql: added derived_cols_remove(), which allows derived columns to be re-created in a different order

14371 07/27/2014 03:01 PM Aaron Marcuse-Kubitza

schemas/util.sql: added drop_derived_col(), which ensures that drop_column() only cascades to views

14370 07/27/2014 02:54 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: drop_column(): also need to recreate dependent views

14369 07/27/2014 02:26 PM Aaron Marcuse-Kubitza

schemas/util.sql: added drop_constraint()

14355 07/26/2014 06:54 PM Aaron Marcuse-Kubitza

schemas/util.sql: remove_prefix(), remove_suffix(): support case-insensitive matching

14354 07/26/2014 06:52 PM Aaron Marcuse-Kubitza

schemas/util.sql: added case-sensitive-optional versions of starts_with(), ends_with()

14353 07/26/2014 06:50 PM Aaron Marcuse-Kubitza

schemas/util.sql: added canon_case(str text, case_sensitive boolean)

14352 07/26/2014 06:36 PM Aaron Marcuse-Kubitza

schemas/util.sql: check_constraint_disable(): documented that we can't use ADD CONSTRAINT NOT VALID for this because it does not disable the constraint completely, but instead causes new rows to be validated against it. the ADD CONSTRAINT NOT VALID behavior does not work for the derived columns use case of this function.

14350 07/26/2014 06:14 PM Aaron Marcuse-Kubitza

schemas/util.sql: rematerialize_view(): support updating just the table's schema, without populating it

14349 07/26/2014 05:37 PM Aaron Marcuse-Kubitza

schemas/util.sql: rematerialize_view(): don't need extra eval() around table_mod_sql because recreate() performs eval()

14345 07/26/2014 03:47 PM Aaron Marcuse-Kubitza

schemas/util.sql: rematerialize_view(): added support for table mods to run after creating table

14344 07/26/2014 04:53 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: rematerialize_view(): don't populate unless recreate() can successfully recreate the dependent views, to avoid populating the entire table (which for some views can take hours) only to have the changes rolled back by a failing dependent view

14343 07/26/2014 04:42 AM Aaron Marcuse-Kubitza

schemas/util.sql: removed no longer used materialize_view(). use util.copy() instead.

14342 07/26/2014 04:41 AM Aaron Marcuse-Kubitza

schemas/util.sql: rematerialize_view(): call util.copy() directly instead of via util.materialize_view()

14341 07/26/2014 04:35 AM Aaron Marcuse-Kubitza

schemas/util.sql: removed no longer used copy_types_and_data(). use util.materialize_view() instead.

14340 07/26/2014 04:20 AM Aaron Marcuse-Kubitza

schemas/util.sql: to_freq(): use util.copy() instead of util.copy_types_and_data() to avoid a dependency on util.copy_types_and_data()

14339 07/25/2014 09:57 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: copy_data(): also need to ANALYZE table after loading data into it

14333 07/25/2014 02:31 PM Aaron Marcuse-Kubitza

schemas/util.sql: derived_col_constraint_initially_enabled(): clarified that this is always based on whether the existing constraint is enabled

14331 07/25/2014 02:12 PM Aaron Marcuse-Kubitza

schemas/util.sql: added derived_cols_export(), which creates SQL to port the derived cols to another DB

14322 07/22/2014 05:24 AM Aaron Marcuse-Kubitza

bugfix: derived_col_constraints_enable(): also need to update col comments, in addition to table__fill_derived()

14321 07/22/2014 04:54 AM Aaron Marcuse-Kubitza

schemas/util.sql: check_constraint_enabled(): made it IMMUTABLE

14320 07/22/2014 04:48 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: derived_col_constraints_enable(): need to update table__fill_derived() w/ formatting changes from enabling constraints

14319 07/22/2014 04:40 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: derived_col_constraints_enable(): need to update table__fill_derived() w/ formatting changes from enabling constraints

14316 07/22/2014 03:57 AM Aaron Marcuse-Kubitza

fix: schemas/util.sql: derived_cols_populate(): documented that this function will sometimes not repopulate columns when needed, such as after changing the column order. in these cases, it is necessary to run util.derived_cols_repopulate() manually.

14315 07/22/2014 03:53 AM Aaron Marcuse-Kubitza

schemas/util.sql: derived_cols_populate(): use new derived_cols_repopulate()

14314 07/22/2014 03:51 AM Aaron Marcuse-Kubitza

schemas/util.sql: added derived_cols_repopulate()

14309 07/22/2014 02:44 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: derived_cols_trigger_update(): need to clear derived cols first so old values won't be used in calculations

14308 07/22/2014 02:36 AM Aaron Marcuse-Kubitza

inputs/.TNRS/schema.sql: derived_cols_trigger_update(): put expr on same line as var, to save space

14307 07/22/2014 02:33 AM Aaron Marcuse-Kubitza

inputs/.TNRS/schema.sql: derived_cols_trigger_update(): removed lines between statements, which add too much space

14306 07/22/2014 02:27 AM Aaron Marcuse-Kubitza

fix: schemas/util.sql: derived_cols_trigger_update(): don't indent expr because may have multiple lines

14305 07/22/2014 02:25 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: derived_col_update(): set_comment(): vars can't have same name as params, which will be substituted

14293 07/21/2014 11:56 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: view_body(): need to match view defs without trailing \n

14292 07/21/2014 11:53 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: view_body(): need to support both CREATE statements and view bodies

14291 07/21/2014 11:23 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: raise(): use eval_raw() so that functions called by eval() (such as view_def_to_orig()) can use raise() for debugging

14290 07/21/2014 09:30 PM Aaron Marcuse-Kubitza

schemas/util.sql: eval(): use new eval_raw()

14289 07/21/2014 09:29 PM Aaron Marcuse-Kubitza

schemas/util.sql: added eval_raw()

14288 07/21/2014 07:52 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: view_is_automatically_updatable(), view_is_subset(): use util.view_body() so not matching COMMENT statements, etc

14287 07/21/2014 07:35 PM Aaron Marcuse-Kubitza

schemas/util.sql: added view_body()

14286 07/21/2014 07:03 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: view_is_subset(): need to support "(x)" in col name

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

fix: schemas/util.sql: derived_col_update(): column comment: formula: put on own line to support multiline exprs

14282 07/21/2014 05:26 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: derived_col_update(): column comment: need to use expr from DB, not as provided by user, to avoid this changing when derived_col_update() is rerun

14280 07/21/2014 05:03 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: derived_col_expr_from_check_constraint(): need to handle strs with \n after IS DISTINCT FROM

14276 07/21/2014 04:05 PM Aaron Marcuse-Kubitza

schemas/util.sql: added derived_col_name_from_check_constraint()

14275 07/21/2014 03:48 PM Aaron Marcuse-Kubitza

schemas/util.sql: derived_col_update(): add steps to rename column

14273 07/21/2014 03:34 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: derived_col_update(): don't set_comment() until CHECK constraint exists so that we can use its canon-ed formula

14272 07/21/2014 03:24 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: check_constraint_expr_enable(): don't remove suffix without also removing prefix. this is done by using extract_by_regexp() instead. also changed check_constraint_enabled() to use regexps to match this.

14271 07/21/2014 03:08 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: extract_by_regexp(): needs surrounding COALESCE in case no match

14270 07/21/2014 03:05 PM Aaron Marcuse-Kubitza

schemas/util.sql: added extract_by_regexp()

14263 07/21/2014 08:12 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: canon_sql(): need to use the right search_path

14262 07/21/2014 08:12 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: check_constraint view: def: must use our wrapper so that the right search_path is used

14261 07/21/2014 08:08 AM Aaron Marcuse-Kubitza

schemas/util.sql: added pg_get_expr() wrapper, which sets search_path to pg_temp

14260 07/21/2014 07:41 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: check_constraint_expr_*(): updated strings for new Mac Postgres update, which was installed on reboot

14259 07/21/2014 07:40 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: check_constraint_expr_*(): updated strings for new Mac Postgres update, which was installed on reboot

14258 07/21/2014 06:55 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: derived_col_update(): steps to modify: also need to run util.derived_cols_populate()

14256 07/21/2014 06:50 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: check_constraint view: can't use consrc because this doesn't get auto-updated with column renames

14255 07/21/2014 06:37 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: derived_col_constraints_enable(): need final `SELECT NULL::void` so don't fold away functions called in previous query

14253 07/21/2014 06:19 AM Aaron Marcuse-Kubitza

bugfix: derived_col_constraint_initially_enabled(): must be both already enabled and unchanged to be initially enabled (r14240 was only partially correct)

14252 07/21/2014 06:08 AM Aaron Marcuse-Kubitza

schemas/util.sql: derived_cols_trigger_update(): to regenerate instructions: use util.derived_cols_update(), which also performs other updates

14251 07/21/2014 06:07 AM Aaron Marcuse-Kubitza

schemas/util.sql: derived_cols_sync(): renamed to derived_cols_trigger_update() for clarity

14250 07/21/2014 06:05 AM Aaron Marcuse-Kubitza

schemas/util.sql: added derived_cols_update()

14249 07/21/2014 05:58 AM Aaron Marcuse-Kubitza

schemas/util.sql: derived_cols_sync(): renamed to derived_cols_trigger_update() for clarity

14248 07/21/2014 05:54 AM Aaron Marcuse-Kubitza

schemas/util.sql: derived_col_update(): add comment describing how to modify derived column

14247 07/21/2014 05:41 AM Aaron Marcuse-Kubitza

schemas/util.sql: added quote_typed(derived_col_def)

14246 07/21/2014 05:37 AM Aaron Marcuse-Kubitza

schemas/util.sql: added quote_typed(col)

14245 07/21/2014 05:14 AM Aaron Marcuse-Kubitza

schemas/util.sql: derived_cols_sync(): table__fill_derived(): document in the function comment how to regenerate it

14244 07/21/2014 05:08 AM Aaron Marcuse-Kubitza

schemas/util.sql: added mk_set_comment(regprocedure, text)

14243 07/21/2014 05:07 AM Aaron Marcuse-Kubitza

schemas/util.sql: set_comment(): accept anything with a mk_set_comment()

14242 07/21/2014 03:39 AM Aaron Marcuse-Kubitza

fix: schemas/util.sql: check_constraint_expr_disable(): need to use CASE instead of `true OR ` because OR always evaluates both sides, slowing down constraint evaluation

14241 07/21/2014 03:23 AM Aaron Marcuse-Kubitza

fix: schemas/util.sql: check_constraint view: conrelid: don't cast to regclass so can use index scan

14240 07/21/2014 03:21 AM Aaron Marcuse-Kubitza

bugfix: derived_col_constraint_initially_enabled(): use whether existing constraint is already enabled, not whether expr is unchanged (which does not affect the enabled status)

14239 07/21/2014 02:52 AM Aaron Marcuse-Kubitza

schemas/util.sql: check_constraint_canon_sql(): use util.debug_print_return_value() to assist debugging

14238 07/21/2014 02:49 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: check_constraint_replace(): need to use util.check_constraint_canon_sql() instead of util.canon_sql()

14237 07/21/2014 02:40 AM Aaron Marcuse-Kubitza

schemas/util.sql: added check_constraint_canon_sql(). this must be used instead of plain util.canon_sql() because unlike queries, CHECK constraints are not simplified, just standardized.

14236 07/21/2014 02:06 AM Aaron Marcuse-Kubitza

schemas/util.sql: check_constraint_replace(): support not canon-ing def.expr

14235 07/21/2014 12:23 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: CHECK constraint exprs: need to remove the enclosing () to be consistent everywhere

14234 07/20/2014 11:59 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: canon_sql(): need to include the enclosing () because the DB includes them

14233 07/20/2014 11:42 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: canon_sql(): use explain()'s verbose mode to facilitate debugging

14232 07/20/2014 11:38 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: explain(): need to restore NOTICEs in verbose mode

14231 07/20/2014 11:22 PM Aaron Marcuse-Kubitza

schemas/util.sql: explain(): support running in verbose mode

14230 07/20/2014 11:19 PM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: check_constraint_replace(): need to canon the expr, using new util.canon_sql(), so it can be compared with the expr in the DB

14229 07/20/2014 11:18 PM Aaron Marcuse-Kubitza

schemas/util.sql: added canon_sql(expr text, table_ regclass)

14228 07/20/2014 10:45 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: check_constraint view: don't use pretty-print mode, because this format does not match util.canon_sql()

14227 07/20/2014 10:43 PM Aaron Marcuse-Kubitza

fix: schemas/util.sql: check_constraint_expr_enable(), derived_col_expr_from_check_constraint(): trim parens in order to support non-pretty-print mode, which is needed with canon_sql()

14226 07/20/2014 09:27 PM Aaron Marcuse-Kubitza

schemas/util.sql: added canon_sql(expr text)

14225 07/20/2014 09:21 PM Aaron Marcuse-Kubitza

schemas/util.sql: added trim_parens()

14224 07/20/2014 08:19 PM Aaron Marcuse-Kubitza

schemas/util.sql: added copy_struct(from_ regtype, to_ text) and copy_data(from_ regtype, to_ text), and use these in a general-purpose copy()