Re: Invoice number

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Kaare Rasmussen <kar(at)webline(dot)dk>
Cc: PostgreSQL-SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Invoice number
Date: 2000-12-21 17:08:49
Message-ID: Pine.BSF.4.21.0012210905420.86012-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


> I'm wondering how people creates guaranteed sequential numbers - in my case
> for invoice numbers.
>
> - Sequences are not rollback'able.
> - It seems overkill to have a table just for this.
> - What else?

You'll probably need a table (although you may be able to get away with
only one for all of these you want to do). The big issue here is locking
since a second transaction looking to get a number needs to wait for
an earlier transaction that has already gotten a number to either commit
or rollback to reuse the number if necessary.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2000-12-21 17:10:21 Re: Create table doesn't work in plpgsql
Previous Message Mike Castle 2000-12-21 15:54:56 Re: Create table doesn't work in plpgsql