Search Postgresql Archives
Reset Sequence number
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Subject
: Reset Sequence number
From
: Brahmam Eswar <brahmam1234@xxxxxxxxx>
Date
: Wed, 22 Nov 2017 15:06:11 +0530
we are in process of migrating to postgres and need to reset the sequence number with highest value of table key . I want to make it procedural to do that as mentioned below,But it's throwing an error .
DO $$
DECLARE
SEQ BIGINT;
BEGIN
SEQ:=(SELECT MAX(ID) FROM TABLE_1);
ALTER SEQUENCE TABLE_1_SEQ RESTART WITH SEQ;
END$$;
Error : syntax error at or near "SEQ"
--
Thanks & Regards,
Brahmeswara Rao J.
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Follow-Ups
:
Re: Reset Sequence number
From:
Thomas Kellerer
Re: Reset Sequence number
From:
Raymond O'Donnell
Re: Reset Sequence number
From:
amul sul
Prev by Date:
Re: One Partition by list is always chosen by planner
Next by Date:
Re: Reset Sequence number
Previous by thread:
backends stuck in "startup"
Next by thread:
Re: Reset Sequence number
Index(es):
Date
Thread
[Index of Archives]
[Postgresql Jobs]
[Postgresql Admin]
[Postgresql Performance]
[Linux Clusters]
[PHP Home]
[PHP on Windows]
[Kernel Newbies]
[PHP Classes]
[PHP Books]
[PHP Databases]
[Postgresql & PHP]
[Yosemite]