Re: How to reset sequences on pre-7.1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Matteo Beccati" <m(dot)beccati(at)crpsoftware(dot)it>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to reset sequences on pre-7.1
Date: 2002-04-17 15:25:35
Message-ID: 6669.1019057135@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Matteo Beccati" <m(dot)beccati(at)crpsoftware(dot)it> writes:
> I usually use a:

> SELECT setval('seq_name', NULL);

> to reset sequences, so the next time it's called it returns '1'. This
> works in all Pg releases I've ever tested but 7.0.

On all recent releases, that is a complete no-op, because setval() is
a strict function. Better check what you were actually doing.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2002-04-17 16:08:58 Re: [SQL] 16 parameter limit
Previous Message Miguel Carvalho 2002-04-17 14:53:53 Re: Need some help with dates