Re: Conditional JOINs ? - Mailing list pgsql-general

From Leon Mergen
Subject Re: Conditional JOINs ?
Date
Msg-id 5eaaef180803181350o7525de64y55b703906ce6811d@mail.gmail.com
Whole thread Raw
In response to Re: Conditional JOINs ?  (Erik Jones <erik@myemma.com>)
Responses Re: Conditional JOINs ?  (Erik Jones <erik@myemma.com>)
List pgsql-general
Hello Erik,

On 3/18/08, Erik Jones <erik@myemma.com> wrote:
> Table partitioning is normally implemented via table inheritance and
>  you are free to add more, and different, columns to the "child" tables.
>
>  Observe:
>
>  CREATE SEQUENCE part_seq;
>  CREATE TABLE parent (
>         id integer PRIMARY KEY DEFAULT nextval('part_seq'),
>         foo text
>  );
>
>  CREATE TABLE child1 (
>         bar text,
>         CHECK(foo='some_type1'),
>         PRIMARY KEY (id)
>  ) INHERITS (parent);
>
>  CREATE TABLE child2 (
>         baz text,
>         CHECK(foo='some_type2'),
>         PRIMARY KEY (id)
>  ) INHERITS (parent);
>
>  Now, both child1 and child2 have id and foo fields, child1 will only
>  allow entries with foo='some_type1', child2 will only allow entries
>  with foo='some_type2', and both children have extra fields that
>  weren't present in the parent.

Ah, silly that I failed to understand that.

Thanks a lot for your response (Alban too) -- I can see table
partitioning solving my problem.

--
Leon Mergen
http://www.solatis.com

pgsql-general by date:

Previous
From: veejar
Date:
Subject: Database recovery
Next
From: Erik Jones
Date:
Subject: Re: Conditional JOINs ?