Search Postgresql Archives

Re: Conditional JOINs ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Erik,

On 3/18/08, Erik Jones <erik@xxxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux