Search Postgresql Archives

Re: Reset Sequence number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22/11/17 09:36, Brahmam Eswar wrote:

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);

select max(id) into seq from table_1;

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@xxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[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]

  Powered by Linux