add sequence part
This commit is contained in:
parent
ade1932487
commit
5ae312fdad
@ -26,3 +26,20 @@ pg_upgrade -b /opt/pgsql-PG_VERSION/bin -B /usr/bin -d /var/lib/postgres/olddata
|
|||||||
```
|
```
|
||||||
- check both pg_hba.conf in new and old cluster
|
- check both pg_hba.conf in new and old cluster
|
||||||
- restart server `sc-start postgresql`
|
- restart server `sc-start postgresql`
|
||||||
|
|
||||||
|
# sequece manipulation
|
||||||
|
|
||||||
|
sequence are use to generate uniq identifier
|
||||||
|
- get sequence value
|
||||||
|
```SQL
|
||||||
|
select * from name_seq;
|
||||||
|
```
|
||||||
|
- increment sequence value
|
||||||
|
```SQL
|
||||||
|
select nextval(name_seq);
|
||||||
|
```
|
||||||
|
|
||||||
|
- set sequence value:
|
||||||
|
```SQL
|
||||||
|
select setval(name_seq,newvalue);
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user