From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Cc: Bruno Wolff III <bruno@wolff.to>
Cc: Andrew Sullivan <ajs@crankycanuck.ca>
Subject: Re: PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly
Date: Fri, 26 May 2006 10:22:54 -0400
Message-ID: <20060526142254.GB5939@phlogiston.dyndns.org> (raw)
In-Reply-To: <20060526140820.GA17450@wolff.to>
References: <20060526101207.5C4B35B0B83@svr4.postgresql.org>
<20060526105037.GB5492@phlogiston.dyndns.org>
<20060526140820.GA17450@wolff.to>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ajs@crankycanuck.ca, bruno@wolff.to
Subject: Re: PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly
In-Reply-To: <20060526142254.GB5939@phlogiston.dyndns.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox