Monday, June 16, 2008

Re: [GENERAL] inserting to a multi-table view

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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

No comments: