pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki@enterprisedb.com>
To: giuseppe@eppesuigoccas.homedns.org
Cc: Jeff Hubbach <jeff.hubbach@cha.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Transaction atomicity
Date: Wed, 07 Mar 2007 16:36:44 +0000
Message-ID: <45EEEA1C.5050105@enterprisedb.com> (raw)
In-Reply-To: <C2143278.1F03%jeff.hubbach@cha.com>
References: <C2143278.1F03%jeff.hubbach@cha.com>

Jeff Hubbach wrote:
> Why not have a compound key on this table, with an ID generated by a
> sequence (one sequence, named the same, for each instance of PostgreSQL for
> each office), and an Office ID that is static for each instance? Then the
> merge/sync would go through without a hitch. 

That's what I was thinking.

If you don't want to have a two-field key, for example because you can't 
change the schema you already have, you could still divide a range of 
ids for each office when you create the sequence:

CREATE SEQUENCE fooseq MINVALUE 10000000 MAXVALUE 19999999 NO CYCLE

Just use a different range for each office.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



view thread (13+ messages)  latest in thread

Message-ID: <45EEEA1C.5050105@enterprisedb.com>
Permalink:  ../45EEEA1C.5050105@enterprisedb.com/
Also on:    postgresql.org/message-id/45EEEA1C.5050105@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: heikki@enterprisedb.com, giuseppe@eppesuigoccas.homedns.org, jeff.hubbach@cha.com
  Subject: Re: Transaction atomicity
  In-Reply-To: <45EEEA1C.5050105@enterprisedb.com>
  References: <C2143278.1F03%jeff.hubbach@cha.com> <45EEEA1C.5050105@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox