Re: custom serial number

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: custom serial number
Date: 2008-11-19 13:37:19
Message-ID: 20081119133719.GA8238@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

am Wed, dem 19.11.2008, um 0:52:07 -0800 mailte mahmoud ewiwi folgendes:
> Thank you very much, it works fine with me , but how can i restart the sequence at the start of each month, or should i do it programatically?

For instance, check if a record for the actual month are in the table.
If not, use setval() to reset the sequence to 1.

http://www.postgresql.org/docs/8.3/interactive/functions-sequence.html

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Sabin Coanda 2008-11-19 15:26:34 VACUUM cannot be executed from multi-command string
Previous Message Bart van Houdt 2008-11-19 12:11:32 Query to retrieve all indexed columns