Project

General

Profile

« Previous | Next » 

Revision 8102

schemas/functions.sql: Added rename_if_exists()

View differences:

schemas/functions.sql
583 583

  
584 584

  
585 585
--
586
-- Name: rename_if_exists(text); Type: FUNCTION; Schema: functions; Owner: -
587
--
588

  
589
CREATE FUNCTION rename_if_exists(sql text) RETURNS void
590
    LANGUAGE plpgsql STRICT
591
    AS $$
592
BEGIN
593
    EXECUTE sql;
594
EXCEPTION
595
    WHEN undefined_column THEN NULL;
596
END;
597
$$;
598

  
599

  
600
--
601
-- Name: FUNCTION rename_if_exists(sql text); Type: COMMENT; Schema: functions; Owner: -
602
--
603

  
604
COMMENT ON FUNCTION rename_if_exists(sql text) IS 'idempotent';
605

  
606

  
607
--
586 608
-- Name: to_global_col_names(regclass); Type: FUNCTION; Schema: functions; Owner: -
587 609
--
588 610

  

Also available in: Unified diff