From 5ae312fdadf0d72e341d0bb1d6fc0fb3b57f05fd Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 19 Apr 2021 10:45:07 +0200 Subject: [PATCH] add sequence part --- IT/SQL/PostgreSQL/Upgrade.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/IT/SQL/PostgreSQL/Upgrade.md b/IT/SQL/PostgreSQL/Upgrade.md index c905f6e..72e7c17 100644 --- a/IT/SQL/PostgreSQL/Upgrade.md +++ b/IT/SQL/PostgreSQL/Upgrade.md @@ -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 - 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); +``` \ No newline at end of file