X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 74900D7AA7 for ; Wed, 24 Aug 2005 21:39:57 -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 52294-02 for ; Thu, 25 Aug 2005 00:39:55 +0000 (GMT) Received: from stark.xeocode.com (stark.xeocode.com [216.58.44.227]) by svr1.postgresql.org (Postfix) with ESMTP id 38F7CD7A4B for ; Wed, 24 Aug 2005 21:39:54 -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 1E85mY-0004Uv-00; Wed, 24 Aug 2005 20:39:50 -0400 To: William Yu Cc: pgsql-general@postgresql.org Subject: Re: Postgresql replication References: <60fyszpby5.fsf@dba2.int.libertyrms.com> <20050824173106.76233.qmail@web53210.mail.yahoo.com> In-Reply-To: From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 24 Aug 2005 20:39:50 -0400 Message-ID: <877jeaetnt.fsf@stark.xeocode.com> Lines: 24 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.003 required=5 tests=[AWL=0.003] X-Spam-Level: X-Archive-Number: 200508/1252 X-Sequence-Number: 82660 William Yu writes: > Allocation of unique IDs that don't collide across servers is a must. For 1 > project, instead of using numeric IDs, we using CHAR and pre-append a unique > server code so record #1 on server A is A0000000001 versus ?x0000000001 on other > servers. For the other project, we were too far along in development to change > all our numerics into chars so we wrote custom sequence logic to divide our > 10billion ID space into 1-Xbillion for server 1, X-Ybillion for server 2, etc. I would have thought setting the sequences to "INCREMENT BY 100" would let you handle this simply by setting the sequences on each server to start at a different value modulo 100. I wonder if it might be handy to be able to set default sequence parameters on a per-database level so that you could set this up and then just do a normal pg_restore of the same schema and get proper non-conflicting sequences on each server. I suppose it's the least of your problems though. -- greg