Re: inserting to a multi-table view - Mailing list pgsql-general

From Craig Ringer
Subject Re: inserting to a multi-table view
Date
Msg-id 48572F14.2080400@postnewspapers.com.au
Whole thread Raw
In response to inserting to a multi-table view  ("Michael Shulman" <shulman@mathcamp.org>)
Responses Re: inserting to a multi-table view  ("Michael Shulman" <shulman@mathcamp.org>)
List pgsql-general
Michael Shulman wrote:

> I want to be able to do INSERTs on "studentinfo" and have rows created
> in both "person" and "student".  This requires first inserting into
> "person", capturing the "person_id" of the resulting row, and using it
> to insert into "student".  This seems as though it must be a common
> situation.

Have you considered using table inheritance to solve this?

It has some limitations, and I've never seen the need myself, but it
sounds like it might fit your needs.

http://www.postgresql.org/docs/8.3/static/ddl-inherit.html

--
Craig Ringer

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: inserting to a multi-table view
Next
From: "Michael Shulman"
Date:
Subject: Re: inserting to a multi-table view