Re: Unique value over different servers - Mailing list pgsql-general

From Einar Karttunen
Subject Re: Unique value over different servers
Date
Msg-id Pine.LNX.4.30.0105281407001.23524-100000@melkinpaasi.cs.Helsinki.FI
Whole thread Raw
In response to Unique value over different servers  (Per-Olof Pettersson <pgsql@peope.net>)
List pgsql-general
On Mon, 28 May 2001, Per-Olof Pettersson wrote:

> I have two databases on two different servers.
>
> I'd like to make a field that will be unique on both servers.
>
> Is this possible. How do I accompish that. Is oid a good value to use?
> Is there a function for it?
>
oid is not the way to do it. Currently there is IMHO no easy and good way
to implement it. If you don't mind using a very non-portable and bad way
of doing it you could for example create the following sequences:
in db1:
CREATE SEQUENCE unique_values_in_both_dbs INCREMENT 2 MINVALUE 1;
in db2:
CREATE SEQUENCE unique_values_in_both_dbs INCREMENT 2 MINVALUE 2;

But this not not a solution you should use if you have an alternative


Einar Karttunen


pgsql-general by date:

Previous
From: fabrizio.ermini@sysdat.it
Date:
Subject: Re: Maximum time execution time error
Next
From: "Sergey E. Volkov"
Date:
Subject: Re: Return cursor