Re: How to generate unique invoice numbers foreach day - Mailing list pgsql-general

From Rich Shepard
Subject Re: How to generate unique invoice numbers foreach day
Date
Msg-id alpine.LNX.2.00.1101151236430.32107@salmo.appl-ecosys.com
Whole thread Raw
In response to Re: How to generate unique invoice numbers foreach day  ("Andrus Moor" <kobruleht2@hot.ee>)
List pgsql-general
On Sat, 15 Jan 2011, Andrus Moor wrote:

> There are 365 days in year. Do you really think pre-creating sequence for
> every day for every year is best solution ?

Andrus,

   I just saw this thread so my idea may not work for you. What I'd do is use
the Julian date (that is, the sequential day from 1-365/6) followed by 1, 2,
or 3 digits depending on how many invoices are generated each day. Makes
sorting and comparisons simple.

Rich

pgsql-general by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Need help writing exclusion constraint
Next
From: Jon Smark
Date:
Subject: Re: Record with a field consisting of table rows