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

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
Subject: Re: PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly
Date: 2006-05-26 14:22:54
Message-ID: 20060526142254.GB5939@phlogiston.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)crankycanuck(dot)ca
The plural of anecdote is not data.
--Roger Brinner

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Merlin Moncure 2006-05-26 14:53:38 Re: [SQL] (Ab)Using schemas and inheritance
Previous Message Bruno Wolff III 2006-05-26 14:08:20 Re: PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly