Re: Inheritance and shared sequence

From: Richard Huxton <dev(at)archonet(dot)com>
To: Sebastjan Trepca <trepca(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance and shared sequence
Date: 2007-06-07 08:44:07
Message-ID: 4667C557.5000600@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sebastjan Trepca wrote:
> Hi,
>
> as I understood, when you create a table which inherits some other
> table, the constraints and indexes do not go to the child table hence
> you have to create a separate ones in there. That means you cannot
> depend that you won't have duplicate IDs in both tables. Right?
>
> BUT...what if child table and parent table both use the same sequence
> for the primary key. Would the duplication still be an issue?

Well, if you *always* use the sequence you'll be OK (until you run out
of numbers), but it won't stop you manually supplying your own values.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message phillip 2007-06-07 08:51:59 failing to start posgresql.
Previous Message Dave Page 2007-06-07 08:40:06 Re: pl/pgsql debuging, was Re: debugging C functions