Received: from smtp.networkusa.net (smtp.networkusa.net [216.15.144.12]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBLJ8o633385 for ; Thu, 21 Dec 2000 14:08:50 -0500 (EST) (envelope-from dalgoda@ix.netcom.com) Received: from ylum.mrc-home.org (109-62.bestdsl.net [216.162.109.62]) by smtp.networkusa.net (8.8.7/8.8.7) with ESMTP id OAA21666 for ; Thu, 21 Dec 2000 14:01:00 -0600 Received: from thune.mrc-home.org by ylum.mrc-home.org (8.10.0) id K1OJ8F424849; Sun, 24 Feb 1980 13:08:15 -0600 Received: by thune.mrc-home.org (8.10.0) id eBLJ8XQ05774; Thu, 21 Dec 2000 13:08:33 -0600 Date: Thu, 21 Dec 2000 13:08:33 -0600 From: Mike Castle To: PostgreSQL-SQL Subject: Re: Invoice number Message-ID: <20001221130833.C5263@thune.mrc-home.org> Reply-To: Mike Castle Mail-Followup-To: Mike Castle , PostgreSQL-SQL References: <200012211750.eBLHohP12000@linda.lfix.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.6i In-Reply-To: <200012211750.eBLHohP12000@linda.lfix.co.uk>; from olly@lfix.co.uk on Thu, Dec 21, 2000 at 05:50:43PM +0000 X-Archive-Number: 200012/255 X-Sequence-Number: 592 On Thu, Dec 21, 2000 at 05:50:43PM +0000, Oliver Elphick wrote: > Mike Castle wrote: > >On Thu, Dec 21, 2000 at 11:10:00AM +0100, Kaare Rasmussen wrote: > >> - Sequences are not rollback'able. > > > >Did you mean SERIAL instead of sequence here? > > > >If so, why is no rollbackable an issue? All you should need is unique > >numbers. Not necessarily exactly sequential numbers. > > For invoice numbers, it matters. > > Numbers missing from such a sequence are likely to provoke questions from > auditors and taxmen; why borrow trouble? What do you do on the following scenario: Client 1 is placing an order, gets invoice #1. Client 2 is simultaneously placing an order, and gets invoice #2. Client 1 changes mind and cancels order. Invoice #1 is not used. Invoice #2 is. Client 3 comes along. Do they use invoice #1, out of order, or invoice #3? I suppose of the assignment of the invoice number is set up in such a way as it is the very last action performed just before the commit, you should be able to ensure that indeed the situation of having to deal with a rollback would never occur (outside of a system crash between assignment of invoice and commit, and that could be explained to auditors). [What happens in a paper world if a cup of coffee is spilt on some invoices, and these precious items are thrown in the trash?] mrc -- Mike Castle Life is like a clock: You can work constantly dalgoda@ix.netcom.com and be right all the time, or not work at all www.netcom.com/~dalgoda/ and be right at least twice a day. -- mrc We are all of us living in the shadow of Manhattan. -- Watchmen