Project

General

Profile

« Previous | Next » 

Revision 14331

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

View differences:

trunk/schemas/util.sql
2059 2059

  
2060 2060

  
2061 2061
--
2062
-- Name: derived_cols_export(regclass); Type: FUNCTION; Schema: util; Owner: -
2063
--
2064

  
2065
CREATE FUNCTION derived_cols_export(table_ regclass) RETURNS text
2066
    LANGUAGE sql STABLE
2067
    AS $_$
2068
SELECT string_agg(
2069
$$SELECT util.derived_col_update($$||util.quote_typed(def)||$$);
2070
$$, '')
2071
||$$
2072
SELECT util.derived_cols_populate($$||util.quote_typed(table_)||$$);
2073
$$
2074
FROM util.derived_col_defs(table_) def
2075
$_$;
2076

  
2077

  
2078
--
2079
-- Name: FUNCTION derived_cols_export(table_ regclass); Type: COMMENT; Schema: util; Owner: -
2080
--
2081

  
2082
COMMENT ON FUNCTION derived_cols_export(table_ regclass) IS '
2083
creates SQL to port the derived cols to another DB
2084
';
2085

  
2086

  
2087
--
2062 2088
-- Name: derived_cols_populate(regclass); Type: FUNCTION; Schema: util; Owner: -
2063 2089
--
2064 2090

  

Also available in: Unified diff