Re: Layout question - Mailing list pgsql-novice

From Pierre Thibaudeau
Subject Re: Layout question
Date
Msg-id 74b035bb0604062118k706f289dl3958a33f1bfe7208@mail.gmail.com
Whole thread Raw
In response to Re: Layout question  (Sean Davis <sdavis2@mail.nih.gov>)
List 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..

pgsql-novice by date:

Previous
From: "Pierre Thibaudeau"
Date:
Subject: Foreign keys and inheritance
Next
From: shakil tanvir
Date:
Subject: Scheduled Job at PostgreSQL