Re: [GENERAL] Buggered Sequence

From: "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Cc: "Jason C(dot) Wells" <jcwells(at)u(dot)washington(dot)edu>
Subject: Re: [GENERAL] Buggered Sequence
Date: 1999-12-04 22:08:48
Message-ID: 19991204160848.B19842@rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jason -
Jesse's sugestion should work, but there's a setval() function for
this exact use:

SELECT setval('people_id_seq',44);

I usually use it like this:

SELECT setval('"Experiments_ExptID_seq"',max("ExptID")) from "Experiments";

That automatically sets the sequence value to the current max in the table.

Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm(at)rice(dot)edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 1999-12-05 02:37:02 Re: [GENERAL] PostgreSQL 6.5.3 on SuSE 6.1
Previous Message Jesse Kipp 1999-12-04 21:09:36 Re: [GENERAL] Buggered Sequence