2009-06-29 15 views

Odpowiedz

9

Możesz chcieć sprawdzić fine manual:

SETVAL (regclass, bigint) bigint Ustaw bieżącą wartość sekwencja za

Przykład użycia :;

# create sequence x; 
CREATE SEQUENCE 

# select nextval('x'); 
nextval 
--------- 
     1 
(1 row) 

# select nextval('x'); 
nextval 
--------- 
     2 
(1 row) 

# select nextval('x'); 
nextval 
--------- 
     3 
(1 row) 

# select setval('x', 10000); 
setval 
-------- 
    10000 
(1 row) 

# select nextval('x'); 
nextval 
--------- 
    10001 
(1 row) 

# select nextval('x'); 
nextval 
--------- 
    10002 
(1 row) 
+0

Dzięki, wypróbowałem google i nic nie wymyśliłem. – johannix