Received: from crazypenguins.commandprompt.com (commandprompt.com [64.81.28.146]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eADHXgs82519 for ; Mon, 13 Nov 2000 12:33:42 -0500 (EST) (envelope-from poet@linuxports.com) Received: from crazypenguins.commandprompt.com (crazypenguins.commandprompt.com [64.81.28.146]) by crazypenguins.commandprompt.com (8.9.3/8.9.3) with ESMTP id JAA02133; Mon, 13 Nov 2000 09:26:18 -0800 Date: Mon, 13 Nov 2000 09:26:18 -0800 (PST) From: Poet/Joshua Drake X-Sender: To: Steve Wampler cc: postgres-sql Subject: Re: Using a postgres table to maintain unique id? In-Reply-To: <3A102122.33733FF1@noao.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200011/93 X-Sequence-Number: 124 >However, I also use Postgres (7.0.2) throughout this >application and it seems cleaner to me to keep the current >id value in a table and just use postgres to provide access >(with a trigger function to increment the id on access). Why not a sequence? >Is this reasonable? Is it fast? (I need 10 or more IDs >generated each second.) Can I avoid having the table >gradually fill with "old" rows for this entry, and this >avoid the need to run VACUUM ANALYZE periodically? The only problem I have had with this type of thing is when a number gets deleted, it does not get recycled. Joshua Drake > >Any tips on how to implement the trigger would be >appreciated. (Is it possible to generate an int8 sequence >value?) > >Thanks! >-- >Steve Wampler- SOLIS Project, National Solar Observatory >swampler@noao.edu > -- -- CommandPrompt - http://www.commandprompt.com OpenDocs, LLC. - http://www.opendocs.org LinuxPorts - http://www.linuxports.com LDP - http://www.linuxdoc.org -- Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom. --