Re: Problem with inheritance

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: Alfonso Peniche <alfonso(at)iteso(dot)mx>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem with inheritance
Date: 2001-01-26 16:44:41
Message-ID: 200101261644.f0QGifF12111@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alfonso Peniche wrote:
>Hi all....
>
>I have the following inheritance relation:
>
> user
> |
> ----------
> | |
>student employee
>
>If I insert John into table student, how can I insert him afterwards so
>that he is also an employee (this could happen several days later)?

You probably need to rethink your hierarchy. If you want to persist
with inheritance, you could define another table, student_employee,
which multiply-inherits student and employee.

Incidentally, `user' is a reserved word; you will have to change the
table name for 7.0.3, or else double-quote it every time you use it.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Wash me thoroughly from mine iniquity, and cleanse me
from my sin. For I acknowledge my transgressions; and
my sin is ever before me. Against thee, thee only,
have I sinned, and done this evil in thy sight..."
Psalms 51:2-4

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Phillips 2001-01-26 16:58:56 Re: Performance: Unix sockets vs. TCP/IP sockets
Previous Message Frank Joerdens 2001-01-26 16:39:51 Re: beta3 Solaris 7 (SPARC) port report