Project

General

Profile

« Previous | Next » 

Revision 10365

schemas/util.sql: added trim(), which trims a table to include only original columns, as defined by a map table

View differences:

schemas/util.sql
1689 1689

  
1690 1690

  
1691 1691
--
1692
-- Name: trim(regclass, regclass); Type: FUNCTION; Schema: util; Owner: -
1693
--
1694

  
1695
CREATE FUNCTION "trim"(table_ regclass, names regclass) RETURNS void
1696
    LANGUAGE sql STRICT
1697
    AS $_$
1698
SELECT util.drop_column(($1, col)) FROM util.derived_cols($1, $2) f (col);
1699
SELECT NULL::void; -- don't fold away functions called in previous query
1700
$_$;
1701

  
1702

  
1703
--
1704
-- Name: FUNCTION "trim"(table_ regclass, names regclass); Type: COMMENT; Schema: util; Owner: -
1705
--
1706

  
1707
COMMENT ON FUNCTION "trim"(table_ regclass, names regclass) IS 'trims table_ to include only original columns, as defined by the names table.
1708
idempotent.';
1709

  
1710

  
1711
--
1692 1712
-- Name: truncate(regclass); Type: FUNCTION; Schema: util; Owner: -
1693 1713
--
1694 1714

  

Also available in: Unified diff