Project

General

Profile

« Previous | Next » 

Revision 14780

schemas/util.sql: added col_rename()

View differences:

util.sql
1501 1501

  
1502 1502

  
1503 1503
--
1504
-- Name: col_rename(col, text); Type: FUNCTION; Schema: util; Owner: -
1505
--
1506

  
1507
CREATE FUNCTION col_rename(from_ col, to_name text) RETURNS void
1508
    LANGUAGE sql
1509
    AS $_$
1510
SELECT util.eval($$ALTER TABLE $$||(from_).table_||$$ RENAME $$
1511
||util.quote_ident((from_).name)||$$ TO $$||util.quote_ident(to_name))
1512
$_$;
1513

  
1514

  
1515
--
1504 1516
-- Name: col_type(col); Type: FUNCTION; Schema: util; Owner: -
1505 1517
--
1506 1518

  

Also available in: Unified diff