Re: Layout question

From: "Pierre Thibaudeau" <pierdeux(at)gmail(dot)com>
To: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
Cc: "Jan Danielsson" <jan(dot)danielsson(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Layout question
Date: 2006-04-07 04:18:33
Message-ID: 74b035bb0604062118k706f289dl3958a33f1bfe7208@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

>
> If you really need the behavior of two tables, you might consider looking
> at
> inheritance.
>

I have something similar to your setup, and I use what Jan suggested. In my
case, the tables "textfiles" and "binaryfiles" inherit from "files". My
table "files" (and therefore the two children) contains a column "kind" that
differentiates between the two children: it's a one-character field,
constrained to be equal to either 't' or 'b'. In the children tables, I
addded to that column a default value: 't' in one case and 'b' in the other.

It's not perfectly satisfactory, but it's the best I have found so far..

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message shakil tanvir 2006-04-07 04:53:54 Scheduled Job at PostgreSQL
Previous Message Pierre Thibaudeau 2006-04-07 02:34:55 Foreign keys and inheritance