Re: Unique value over different servers

Поиск
Список
Период
Сортировка
От Einar Karttunen
Тема Re: Unique value over different servers
Дата
Msg-id Pine.LNX.4.30.0105281407001.23524-100000@melkinpaasi.cs.Helsinki.FI
обсуждение исходный текст
Ответ на Unique value over different servers  (Per-Olof Pettersson <pgsql@peope.net>)
Список 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 по дате отправления:

Предыдущее
От: fabrizio.ermini@sysdat.it
Дата:
Сообщение: Re: Maximum time execution time error
Следующее
От: "Sergey E. Volkov"
Дата:
Сообщение: Re: Return cursor