Re: Duplicate Unique Key constraint error

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Harpreet Dhaliwal <harpreet(dot)dhaliwal01(at)gmail(dot)com>
Cc: Tom Allison <tom(at)tacocat(dot)net>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Duplicate Unique Key constraint error
Date: 2007-07-13 00:58:19
Message-ID: 20070713005819.GC474@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-odbc

Harpreet Dhaliwal escribió:
> How can one rollover a sequence back to zero after you delete records from
> a
> table with one such sequence.
> I see it starting with the last value of the sequence inserted.

You can use setval(), but normally you just leave it alone. Having
numbers not starting from 0 is not a problem in most cases.

--
Alvaro Herrera http://www.flickr.com/photos/alvherre/
Hi! I'm a .signature virus!
cp me into your .signature file to help me spread!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2007-07-13 01:19:13 Re: returns setof rec... simple exampe doesn't work
Previous Message Harpreet Dhaliwal 2007-07-13 00:21:10 Re: Duplicate Unique Key constraint error

Browse pgsql-odbc by date

  From Date Subject
Next Message Ludek Finstrle 2007-07-13 10:07:20 Re: Error in 'psqlodbca.dll'
Previous Message Harpreet Dhaliwal 2007-07-13 00:21:10 Re: Duplicate Unique Key constraint error