Re: SERIAL does not ROLLBACK

From: Tim Pushor <timp(at)crossthread(dot)com>
To: BERG Thomas <tberg(at)insight-system(dot)co(dot)jp>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: SERIAL does not ROLLBACK
Date: 2003-03-12 14:52:27
Message-ID: 3E6F49AB.2030008@crossthread.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

I had thought about this as well - I am developing an invoicing
application for my small business.

There are definately applications that you want to ensure that there are
no 'holes' in the numbers, such as invoice numbers - technical
limitations notwithstanding..

Tim

BERG Thomas wrote:

>I believe this is deliberate on the part of the postgresql programmers. If
>serial numbers could be rolled back, you'd have to block any other
>transactions that wanted a new serial number until the first transaction had
>committed.
>
>I don't know how to get around this, but I'd think pretty carefully before I
>decided to, unless I were an a single-user or extremely few-user scenario.
>
>Berg
>
>-----Original Message-----
>From: pgsql-novice-owner(at)postgresql(dot)org
>[mailto:pgsql-novice-owner(at)postgresql(dot)org]On Behalf Of Muhammad Shariq
>Muzaffar
>Sent: Wednesday, March 12, 2003 4:21 PM
>To: pgsql-sql(at)postgresql(dot)org
>Cc: pgsql-novice(at)postgresql(dot)org
>Subject: [NOVICE] SERIAL does not ROLLBACK
>
>
>hi
>i have a table named 'mytable' with a column of type
>serial. After inserting tuples in a transaction, when
>i rollback the transaction the serial number does not
>come back to its original value and next time when i
>insert the data, it start with the incremented value.
>WHY?? how can i make it to come back to its orignial
>value in case of rollback.
>
>thanx in advance...
>
>__________________________________________________
>Do You Yahoo!?
>Everything you'll ever need on one web page
>from News and Sport to Email and Music Charts
>http://uk.my.yahoo.com
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/docs/faqs/FAQ.html
>
>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2003-03-12 15:13:35 Re: filtering out doubles with SELECT
Previous Message Muhammad Shariq Muzaffar 2003-03-12 14:38:44 create function pl/pgsql c langauge

Browse pgsql-sql by date

  From Date Subject
Next Message Jens Eliasson 2003-03-12 15:25:26 Re: SERIAL does not ROLLBACK
Previous Message David Delorme 2003-03-12 14:15:33 The folding of unquoted names to lower case in PostgreSQL is incompatible with the SQL standard