Shared Sequences?

Lists: pgsql-general
From: "C(dot) Duncan Hudson" <postgresql(at)dunc-it(dot)com>
To: PgSQL General List <pgsql-general(at)postgresql(dot)org>
Subject: Shared Sequences?
Date: 2005-01-02 15:44:16
Message-ID: 41D816D0.7020705@dunc-it.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Is there any way, with PG 8 rc 3, to share a sequence across databases -
assuming all databases are on the same machine? Thanks,

Dunc


From: Andreas Kretschmer <andreas_kretschmer(at)despammed(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Shared Sequences?
Date: 2005-01-02 16:06:44
Message-ID: kpila2-7i7.ln1@kaufbach.delug.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

begin "C. Duncan Hudson" <postgresql(at)dunc-it(dot)com> wrote:
> Is there any way, with PG 8 rc 3, to share a sequence across databases -
> assuming all databases are on the same machine? Thanks,

Possibly via contrib/dblink, also on ealier versions.
I'm not sure about sequences, but with tables this is possible.

end
Andreas
--
Diese Message wurde erstellt mit freundlicher Unterstützung eines freilau-
fenden Pinguins aus artgerechter Freilandhaltung. Er ist garantiert frei
von Micro$oft'schen Viren. (#97922 http://counter.li.org) GPG 7F4584DA
Was, Sie wissen nicht, wo Kaufbach ist? Hier: N 51.05082°, E 13.56889° ;-)


From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "C(dot) Duncan Hudson" <postgresql(at)dunc-it(dot)com>
Cc: PgSQL General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Shared Sequences?
Date: 2005-01-02 18:21:16
Message-ID: 20050102182115.GA44519@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Sun, Jan 02, 2005 at 10:44:16AM -0500, C. Duncan Hudson wrote:

> Is there any way, with PG 8 rc 3, to share a sequence across databases -
> assuming all databases are on the same machine?

As Andreas Kretschmer mentioned, you might be able to use dblink.

Why do you want to share a sequence across databases? Could you
use separate schemas in one database instead of separate databases?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/


From: "C(dot) Duncan Hudson" <postgresql(at)dunc-it(dot)com>
To: PgSQL General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Shared Sequences?
Date: 2005-01-02 21:19:26
Message-ID: 41D8655E.2050204@dunc-it.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Michael Fuhr wrote:

>On Sun, Jan 02, 2005 at 10:44:16AM -0500, C. Duncan Hudson wrote:
>
>
>
>>Is there any way, with PG 8 rc 3, to share a sequence across databases -
>>assuming all databases are on the same machine?
>>
>>
>
>As Andreas Kretschmer mentioned, you might be able to use dblink.
>
>Why do you want to share a sequence across databases? Could you
>use separate schemas in one database instead of separate databases?
>
>
>
Unfortunately, the app that I'm using doesn't yet support schemas -
otherwise I'd be doing that. I have 3 instances of the application
(each for a different business unit) and I don't want them generating
the same numbers for different things. I want the numbers, across all
business units, to be truly chronological - so I'd like them to share
the same sequence.

Dunc


From: Ragnar Hafstað <gnari(at)simnet(dot)is>
To: "C(dot) Duncan Hudson" <postgresql(at)dunc-it(dot)com>
Cc: PgSQL General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Shared Sequences?
Date: 2005-01-02 22:30:10
Message-ID: 1104705010.11499.3.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Sun, 2005-01-02 at 16:19 -0500, C. Duncan Hudson wrote:

[about databases sharing a sequence]

> I have 3 instances of the application
> (each for a different business unit) and I don't want them generating
> the same numbers for different things. I want the numbers, across all
> business units, to be truly chronological - so I'd like them to share
> the same sequence.

do you realize that sequences are not garanteed to be "chronological"?

gnari