Project

General

Profile

« Previous | Next » 

Revision 13566

schemas/util.sql: added seq__reset()

View differences:

trunk/schemas/util.sql
3765 3765

  
3766 3766

  
3767 3767
--
3768
-- Name: seq__reset(text, integer); Type: FUNCTION; Schema: util; Owner: -
3769
--
3770

  
3771
CREATE FUNCTION seq__reset(seq text, start integer DEFAULT 0) RETURNS void
3772
    LANGUAGE sql
3773
    AS $_$
3774
SELECT util.seq__create($1, $2);
3775
SELECT util.eval($$ALTER SEQUENCE $$||$1||$$ RESTART$$);
3776
$_$;
3777

  
3778

  
3779
--
3780
-- Name: FUNCTION seq__reset(seq text, start integer); Type: COMMENT; Schema: util; Owner: -
3781
--
3782

  
3783
COMMENT ON FUNCTION seq__reset(seq text, start integer) IS '
3784
creates sequence if doesn''t exist
3785

  
3786
idempotent
3787

  
3788
start: *note*: only used if sequence doesn''t exist
3789
';
3790

  
3791

  
3792
--
3768 3793
-- Name: set_col_names(regclass, regclass); Type: FUNCTION; Schema: util; Owner: -
3769 3794
--
3770 3795

  

Also available in: Unified diff