aboutsummaryrefslogtreecommitdiff
path: root/contrib/sequence/set_sequence.sql.in
blob: 0f1421b71bdfc56ed989c4cac4b1535bc388efeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
-- SQL code to define new sequence utilities

-- Set a new sequence value
--
create function set_currval(text, int4) returns int4
  as 'MODULE_PATHNAME'
  language 'C';

-- Increment the value of sequence
--
--	select next_id('sequence_name');
--
create function next_id(text) returns int4
  as 'MODULE_PATHNAME'
  language 'C';

-- Return the last value set for a sequence
--
--	select last_id('sequence_name');
--
create function last_id(text) returns int4
  as 'MODULE_PATHNAME'
  language 'C';

-- Set the current value of a sequence
--
--	select set_last_id('sequence_name', 1);
--
create function set_last_id(text,int4) returns int4
  as 'MODULE_PATHNAME'
  language 'C';

-- end of file