schemas/util.sql: added first_col(regclass)
fix: schemas/util.sql: read-only functions should be STABLE rather than VOLATILE
bugfix: schemas/util.sql: functions that access the DB must be STABLE rather than IMMUTABLE
bugfix: schemas/util.sql: derived_col_defs(): derived columns must be returned in table order (which should = dependency order), so that they are populated in dependency order
bugfix: schemas/util.sql: remove_prefix(), remove_suffix(): must be declared STRICT to handle NULL properly
bugfix: schemas/util.sql: remove_suffix(): need to use quote_nullable(str) so a NULL str doesn't NULL out the entire message
bugfix: schemas/util.sql: remove_prefix(): need to use quote_nullable(str) so a NULL str doesn't NULL out the entire message
bugfix: schemas/util.sql: raise(): use new quote_as_str() to avoid "RAISE statement option cannot be null" errors
schemas/util.sql: added quote_as_str()
schemas/util.sql: added CAST (util.col AS util.derived_col_def)
schemas/util.sql: derived_col_def(col): use existing util.check_constraint_def()
schemas/util.sql: added CAST (util.col AS util.table_item)
schemas/util.sql: added derived_col_def(col)
schemas/util.sql: added check_constraint_disable()
bugfix: schemas/util.sql: check_constraint_drop(): need IF EXISTS
schemas/util.sql: added check_constraint_expr_disable()
schemas/util.sql: check_constraint_enable(): documented that this is idempotent
schemas/util.sql: derived_cols_sync(): also create trigger, since this is necessary for a complete sync
schemas/util.sql: added name(regprocedure)
schemas/util.sql: derived_cols_sync(): set the trigger name in a var
schemas/util.sql: added check_constraint_enable()
schemas/util.sql: added check_constraint_replace()
schemas/util.sql: added CAST (util.table_item AS util.check_constraint_def)
schemas/util.sql: added check_constraint_drop()
schemas/util.sql: derived_col_expr_from_check_constraint(): enable initially-disabled exprs
schemas/util.sql: added check_constraint_expr_enable()
fix: schemas/util.sql: check_constraint view: def: use pg_get_expr() with pretty-print, to avoid extra () that complicate parsing
schemas/util.sql: added derived_cols_sync()
bugfix: CAST (util.check_constraint_def AS util.derived_col_def): need to extract the derived column expr from the CHECK constraint expr
schemas/util.sql: added derived_col_expr_from_check_constraint()
schemas/util.sql: added extract_str()
schemas/util.sql: added remove_suffix()
schemas/util.sql: added remove_prefix()
schemas/util.sql: added CAST (util.table_item AS util.col)
schemas/util.sql: derived_col_defs(): return derived_col_def instead of check_constraint_def
schemas/util.sql: added derived_col_def type with cast from util.check_constraint_def
schemas/util.sql: added derived_col_defs()
schemas/util.sql: check_constraint_defs(): use new util.check_constraint view
schemas/util.sql: added check_constraint view
schemas/util.sql: added check_constraint_defs()
schemas/util.sql: added check_constraint_def type
schemas/util.sql: added table_item type
schemas/util.sql: col_ref: renamed to just col
schemas/util.sql: cluster(): support omitting index to recluster a table
schemas/util.sql: cluster_once(): use util.cluster()
schemas/util.sql: cluster_once(): documented that this runs cluster only once if called repeatedly
schemas/util.sql: added cluster(), which reclusters each time
schemas/util.sql: cluster_once(): use simpler `LANGUAGE sql` now that we're using util.eval() instead of EXECUTE
schemas/util.sql: cluster_once(): use util.eval() instead of EXECUTE to print the CLUSTER statement (if any) it's using
bugfix: schemas/util.sql: cluster_once(): need to use just the name of the index, without the schema prefix
schemas/util.sql: cluster_once(): use simpler IS DISTINCT FROM instead of array !=
bugfix: schemas/util.sql: view_is_subset(): auto-updatable views that are not plain subsets: include ones with WHERE clauses
bugfix: schemas/util.sql: view_is_subset(): also need to handle auto-updatable views that are not plain subsets (there are some of these)
bugfix: schemas/util.sql: comment(element oid): need `objsubid = 0` filter so this doesn't use comments for any other objsubids
bugfix: schemas/util.sql: rematerialize_view(): also need to handle the target table's dependent views
bugfix: schemas/util.sql: mk_drop_from_create(): need to use `IF EXISTS` so that the resulting statement also works if the target object does not yet exist
schemas/util.sql: mk_drop_from_create(): also support `SELECT util.drop_*()` statements, in addition to DROP
schemas/util.sql: replace_words(): use map_words() to enable inlining the concatenated hstore, so that it doesn't need to be concatenated on each function call
schemas/util.sql: added map_words()
schemas/util.sql: added date_from_spanish()
schemas/util.sql: added replace_words()
schemas/util.sql: added words(text)
schemas/util.sql: spanish_date_words(): switched to using hstore because this is better for the algorithm that will translate these
schemas/util.sql: added spanish_date_words()
schemas/util.sql: added `replacement` type
bugfix: mk_set_relation_metadata(): need to include col comments as well so that these are re-created properly by recreate()
schemas/util.sql: added mk_set_comments(regclass)
schemas/util.sql: show_set_comment(regclass): renamed to mk_set_comment() to match other mk_set_comment() functions
schemas/util.sql: added mk_set_col_comments(regclass)
schemas/util.sql: added cols(regclass)
schemas/util.sql: added mk_set_comment(col_ref)
schemas/util.sql: mk_set_comment(table_ regclass, comment text): use new util.mk_set_comment(text, text)
schemas/util.sql: added mk_set_comment(col col_ref, comment text)
schemas/util.sql: added sql(col_ref)
schemas/util.sql: added mk_set_comment(on_ text, comment text)
schemas/util.sql: added comment(col_ref)
schemas/util.sql: added col_num(col_ref)
schemas/util.sql: in_south_america(): optimized by using BETWEEN instead of util.contained_within__no_dateline(). this reduces the filter time for 2014-6-4.Iara_Lacher.reserve_prioritization by about 10%.
bugfix: in_south_america(): must use util.contained_within__no_dateline() instead of util.contained_within_approx() to ensure that the more accurate geometry logic is used
schemas/util.sql: materialize_view(): use util.copy() instead of util.materialize_query() so that all view metadata is transferred
schemas/util.sql: added subspecies()
schemas/util.sql: added south_america(), in_south_america()
fix: schemas/util.sql: OPERATOR ~(geocoord, postgis.geometry): renamed to because this is not an approximate comparison for geometry
(geocoord, postgis.geometry): renamed to
fix: schemas/util.sql: contained_within_approx(geocoord, postgis.geometry): renamed to contained_within__no_dateline(__) because this is not an approximate comparison for geometry
schemas/util.sql: lat_long_in_new_world(): renamed to just in_new_world() because the lat/long is implied by the param type
schemas/util.sql: lat_long_in_new_world(): take a geocoord param instead of separate lat/long params
schemas/util.sql: added contained_within_approx(geocoord, geometry) and corresponding OPERATOR ~@(geocoord, geometry)
schemas/util.sql: added OPERATOR ~@(geocoord, geography)
schemas/util.sql: lat_long_in_new_world(): use new contained_within_approx(geocoord, geography)
schemas/util.sql: added contained_within_approx(geocoord, postgis.geography), which enables specifying just `(lat, long)` without the ::util.geocoord type specifier
schemas/util.sql: OPERATOR (postgis.geography, postgis.geography): renamed to ~ because it's approximate
(postgis.geography, postgis.geography): renamed to ~
schemas/util.sql: contained_within(): renamed to contained_within_approx() because the latitude lines of geography type bounding boxes bulge outward, creating false positives above and below the bounding box
schemas/util.sql: added contained_within__no_dateline(geometry, geometry) and corresponding operator @
schemas/util.sql: geometry(geocoord): documented that it is not possible to create a cast for this, as a bug in pg_dump prevents the cast from being exported, even when no export filters are applied
schemas/util.sql: point(geocoord): renamed to geometry(geocoord) since this is now a cast
schemas/util.sql: point(): return geometry instead of geography to support using points with geometry arithmetic
schemas/util.sql: point(): take a single util.geocoord param instead of separate lat/long
schemas/util.sql: added geocoord type
schemas/util.sql: bounding_box(): use bounding_box__no_dateline() to construct the postgis.geometry object