Revision 10364
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/util.sql | ||
---|---|---|
811 | 811 |
|
812 | 812 |
|
813 | 813 |
-- |
814 |
-- Name: derived_cols(regclass, regclass); Type: FUNCTION; Schema: util; Owner: - |
|
815 |
-- |
|
816 |
|
|
817 |
CREATE FUNCTION derived_cols(table_ regclass, names regclass) RETURNS SETOF text |
|
818 |
LANGUAGE sql STABLE STRICT |
|
819 |
AS $_$ |
|
820 |
SELECT util.eval2set($$ |
|
821 |
SELECT col |
|
822 |
FROM util.col_names($$||quote_nullable($1)||$$::regclass) f (col) |
|
823 |
LEFT JOIN $$||$2||$$ ON "to" = col |
|
824 |
WHERE "from" IS NULL |
|
825 |
$$, NULL::text) |
|
826 |
$_$; |
|
827 |
|
|
828 |
|
|
829 |
-- |
|
830 |
-- Name: FUNCTION derived_cols(table_ regclass, names regclass); Type: COMMENT; Schema: util; Owner: - |
|
831 |
-- |
|
832 |
|
|
833 |
COMMENT ON FUNCTION derived_cols(table_ regclass, names regclass) IS 'gets table_''s derived columns (all the columns not in the names table)'; |
|
834 |
|
|
835 |
|
|
836 |
-- |
|
814 | 837 |
-- Name: do_optionally_ignore(text, boolean); Type: FUNCTION; Schema: util; Owner: - |
815 | 838 |
-- |
816 | 839 |
|
Also available in: Unified diff
schemas/util.sql: added derived_cols(), which gets table_'s derived columns (all the columns not in the names table)