Re: Conditional JOINs ?

From: "Leon Mergen" <leon(at)solatis(dot)com>
To: "Erik Jones" <erik(at)myemma(dot)com>
Cc: "Alban Hertroys" <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>, pgsql-general(at)postgresql(dot)org
Subject: Re: Conditional JOINs ?
Date: 2008-03-18 20:50:00
Message-ID: 5eaaef180803181350o7525de64y55b703906ce6811d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello Erik,

On 3/18/08, Erik Jones <erik(at)myemma(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Erik Jones 2008-03-18 21:07:58 Re: Conditional JOINs ?
Previous Message veejar 2008-03-18 20:48:58 Database recovery