Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly



On Fri, May 26, 2006 at 09:08:20AM -0500, Bruno Wolff III wrote:
> 
> Rollbacks will not reset sequence values. Use setval to do that.

No, what I posted was the CREATE SEQUENCE after the BEGIN.  ROLLBACK
gets rid of the sequence.  The next time you create the same
sequence, therefore, it also starts at 1.

I don't actually know what this ranking is useful for, to be honest,
but people ask for it, and this is a stupid Postgres trick that can
make it happen.

A

-- 
Andrew Sullivan  | ajs(at)crankycanuck(dot)ca
The plural of anecdote is not data.
		--Roger Brinner



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group