Re: Advice about a parent-child relation design

From: Felipe Santos <felipepts(at)gmail(dot)com>
To: JORGE MALDONADO <jorgemal1960(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Advice about a parent-child relation design
Date: 2015-11-21 19:53:58
Message-ID: CAPYcRiVWY3TVT1qhmJXoHGM0ELv2iCxd7Ai8AerpSuQg9jCQeg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Em 21/11/2015 3:46 PM, "JORGE MALDONADO" <jorgemal1960(at)gmail(dot)com> escreveu:
>
> I have 2 tables: parent and child. One of the fields, which should
supposedly be part of the parent table, might occassionaly be different for
one of the child table records.
>
> ParentTable
> * id
> * date
> * customer <-----
> * reference
> * other fields...
>
>
> ChildTable
> * id-parent
> * document type
> * customer <-----
>
> It is possible that the customer field is not the same for all of the
child records. This is a very specific (and strange) situation that might
eventually appear in the information system I am developing. I suppose that
such a field must be part of the child table even if this case does not
appear frequently.
>
> I am writing to ask for your feedback and see if there is another
possible approach.
>
> With respect,
> Jorge Maldonado

Hi Jorge,

One question: since the Child table has the parent id , why do you need
to replicate the customer information ?

Regards

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Gavin Flower 2015-11-21 20:12:03 Re: Advice about a parent-child relation design
Previous Message JORGE MALDONADO 2015-11-21 17:45:12 Advice about a parent-child relation design