You can use timeval struct and create a field in your Database as double, and then use these two value tv_sec, and tv_usec to build you PK.
Hisseine ----- Original Message ----- From: "Jonathan Pelletier" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 29, 2002 10:45 AM Subject: Automatic Primary Key for "circular table" > Hi,, > > I'm looking for a way to create a table with a ID columns (PRIMARY KEY) > generated automatically... > > The only probleme is that i cannot use a AUTO_INCREMENT field because I have > thousand of lines added each day (and all lines older than a week are > deleted) With AUTO_INCREMENT, one day or another I'll reach the size > limit of the ID field ;-) > > I could also use a timestamp as a primary key, but i have over 15 process > running at the same time that could make an INSERT query during the same > second, so a timestamp in second is not enough ;-( > > > I'm simply looking for a way to tell Mysql to use the first free value in > the valid range of the field to use as a Primary Key (Ex: specify a INT as > the ID and make MySQL take the first available integer in the INT range as > the ID) > > Any Idea ??? > > > /<><><><><><><><><><><> Jonathan Pelletier <><><><><><><><><><><><>\ > \ B.ing Informatique / > / Matrox Electronic Systems Ltd. \ > \ MIS / Département des systèmes -- Groupe Unix / > / \ > \ 1055 Blv. St-Regis Tel: (514) 822-6000 x.7589 / > / Dorval (Quebec) Fax: (514) 822-6262 \ > \ H9P 2T4 Email: [EMAIL PROTECTED] / > / http://www.matrox.com \ > \ / > / Home: [EMAIL PROTECTED] \ > \<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>/ > _ > ASCII ribbon campaign ( ) > - against HTML email X > & vcards / \ > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php