Revision 10362
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/util.sql | ||
---|---|---|
829 | 829 |
|
830 | 830 |
|
831 | 831 |
-- |
832 |
-- Name: drop_column(col_ref); Type: FUNCTION; Schema: util; Owner: - |
|
833 |
-- |
|
834 |
|
|
835 |
CREATE FUNCTION drop_column(col col_ref) RETURNS void |
|
836 |
LANGUAGE sql STRICT |
|
837 |
AS $_$ |
|
838 |
SELECT util.eval($$ALTER TABLE $$||$1.table_||$$ DROP COLUMN IF EXISTS $$|| |
|
839 |
quote_ident($1.name)) |
|
840 |
$_$; |
|
841 |
|
|
842 |
|
|
843 |
-- |
|
844 |
-- Name: FUNCTION drop_column(col col_ref); Type: COMMENT; Schema: util; Owner: - |
|
845 |
-- |
|
846 |
|
|
847 |
COMMENT ON FUNCTION drop_column(col col_ref) IS 'idempotent'; |
|
848 |
|
|
849 |
|
|
850 |
-- |
|
832 | 851 |
-- Name: drop_table(text); Type: FUNCTION; Schema: util; Owner: - |
833 | 852 |
-- |
834 | 853 |
|
Also available in: Unified diff
schemas/util.sql: added drop_column()