Re: PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly - Mailing list pgsql-sql

From Andrew Sullivan
Subject Re: PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly
Date
Msg-id 20060526142254.GB5939@phlogiston.dyndns.org
Whole thread Raw
In response to Re: PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-sql
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@crankycanuck.ca
The plural of anecdote is not data.    --Roger Brinner


pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly
Next
From: "Jesper K. Pedersen"
Date:
Subject: Re: PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly