0

I've got an old system that uses postgres table inheritance and I don't know much about it, but I have this situation:

there's three tables: "person", "student" and "teacher"

both "student" and "teacher" inherit from "person".

Now, I have a student who became a teacher and I need to save him in both tables. Is this even possible?

1 Answer 1

1

Yes, it's possible. You will have three inserts, one for eache table you want.

insert into person ...
insert into student ...
insert into teacher ...

more information in http://www.postgresql.org/docs/9.1/static/ddl-inherit.html

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, this wasn't working at first because I tried to suppress the repeated data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.