Re: Inheritance and shared sequence - Mailing list pgsql-general

From Richard Huxton
Subject Re: Inheritance and shared sequence
Date
Msg-id 4667C557.5000600@archonet.com
Whole thread Raw
In response to Inheritance and shared sequence  ("Sebastjan Trepca" <trepca@gmail.com>)
Responses Re: Inheritance and shared sequence  (Oliver Elphick <olly@lfix.co.uk>)
List 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

pgsql-general by date:

Previous
From: Dave Page
Date:
Subject: Re: pl/pgsql debuging, was Re: debugging C functions
Next
From: Johannes Konert
Date:
Subject: Suppress checking of chmod 700 on data-dir?