X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 525DBD79DB for ; Tue, 6 Sep 2005 18:32:05 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 91979-06 for ; Tue, 6 Sep 2005 21:31:58 +0000 (GMT) Received: from stark.xeocode.com (stark.xeocode.com [216.58.44.227]) by svr1.postgresql.org (Postfix) with ESMTP id DC8A1D85C8 for ; Tue, 6 Sep 2005 18:31:58 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1ECl2d-0004ut-00; Tue, 06 Sep 2005 17:31:43 -0400 To: mark@mark.mielke.cc Cc: "Jonah H. Harris" , josh@agliodbs.com, pgsql-hackers@postgresql.org, nathan wagner Subject: Re: uuid type for postgres References: <20050906135057.GA24136@granicus.if.org> <20050906144930.GA27641@mark.mielke.cc> <200509061002.43803.josh@agliodbs.com> <36e6829205090612575b954f38@mail.gmail.com> <20050906203811.GA3069@mark.mielke.cc> In-Reply-To: <20050906203811.GA3069@mark.mielke.cc> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 06 Sep 2005 17:31:43 -0400 Message-ID: <878xy9x4qo.fsf@stark.xeocode.com> Lines: 31 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 required=5 tests=[AWL=0.005] X-Spam-Level: X-Archive-Number: 200509/284 X-Sequence-Number: 72681 mark@mark.mielke.cc writes: > In my choice of use, I'm using them instead of SERIAL columns, as I > wish to have more freedom merging production data with test data. I > wish to continually import production data into my test environment, > in a single direction. UUID will prevent conflicts from occurring. > SERIAL cannot (although in theory, I could set my copy of the serial > value to 1 billion or something hacky - but that doesn't scale in a > simple fashion to having several test environments). Just do something like this for every sequence: ALTER SEQUENCE foo INCREMENT BY 100 And then choose a particular initial value for each server. I agree with the others that uuid seems to be overused in lots of cases where a simple serial would serve just as well. However I don't see why a good uuid type is any less of a valid addition to the set of data types than any of the others. inet, macaddr, all the geometric types, for example. Given the 3-phase commit work going into 8.2 (8.1?) it seems like a pretty fundamental component of that whole ball of wax. A note in the documentation that it's designed for use as part of a multiple-database system like that might be helpful. -- greg