Re: Best way to create unique primary keys across schemas?

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: panam <panam(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Best way to create unique primary keys across schemas?
Date: 2012-01-23 03:02:11
Message-ID: CAOR=d=1-vffZurcEj9G8bAJjVMm10FzJFJbDkSYWCnKVq1PfDw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jan 22, 2012 at 5:19 PM, panam <panam(at)gmx(dot)net> wrote:
> Hi,
>
> If I'd like to have primary keys generated ("numeric" style, no UUIDs) that
> are unique across schemas is the best option to allocate a fixed sequence
> range (min,max) to the sequences of all schemas?

That's how I do it. If you use a bigserial / bigint for it, then the
space is usually plenty big for each schema.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ahmed Shinwari 2012-01-23 07:58:25 Re: "could not accept SSPI security context"
Previous Message John R Pierce 2012-01-23 01:09:13 Re: PGbouncer for Windows 2008