Revision 10595
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/util.sql | ||
---|---|---|
1753 | 1753 |
CREATE FUNCTION "trim"(table_ regclass, names regclass) RETURNS void |
1754 | 1754 |
LANGUAGE sql STRICT |
1755 | 1755 |
AS $_$ |
1756 |
SELECT util.drop_column(($1, col)) FROM util.derived_cols($1, $2) f (col);
|
|
1756 |
SELECT util.drop_column(($1, col)) FROM util.added_cols($1, $2) f (col);
|
|
1757 | 1757 |
SELECT NULL::void; -- don't fold away functions called in previous query |
1758 | 1758 |
$_$; |
1759 | 1759 |
|
... | ... | |
1762 | 1762 |
-- Name: FUNCTION "trim"(table_ regclass, names regclass); Type: COMMENT; Schema: util; Owner: - |
1763 | 1763 |
-- |
1764 | 1764 |
|
1765 |
COMMENT ON FUNCTION "trim"(table_ regclass, names regclass) IS 'trims table_ to include only original columns, as defined by the names table.
|
|
1765 |
COMMENT ON FUNCTION "trim"(table_ regclass, names regclass) IS 'trims table_ to include only columns in the original data.
|
|
1766 | 1766 |
idempotent.'; |
1767 | 1767 |
|
1768 | 1768 |
|
Also available in: Unified diff
bugfix: schemas/util.sql: trim(): need to remove all added columns, not just derived columns, because metadata value columns are also added by new-style import and need to be removed to restore a staging table to its pre-new-style state