Insert/Update/Delete views with INSTEAD OF

From: Ben <newreaders(at)gmail(dot)com>
To: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Insert/Update/Delete views with INSTEAD OF
Date: 2007-12-12 22:58:46
Message-ID: 5f4a64610712121458gc26ef9fn48171dc1ef78b6cb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

Does anyone have any recommendations on how to migrate Oracle's
'INSTEAD OF' triggers to PostgreSQL's 'INSTEAD OF' rules?

What I would like to do are:

- When there's an insert to the view, the rule would insert the data
into many tables.
- When there's an update, the rule would insert and update data across tables.
- When there's a delete, update fields in some tables.

I have been trying to use INSTEAD OF rules on these tables and SELECT
the functions to do all the work. The problem is the INSTEAD OF rule
doesn't return the command status when it selects the function. As a
result of this, Hibernate (ORM framework) returns exception because it
expects the command to return the status.

Could someone points me to the right direction, or it's not possible
to do this in PostgreSQL?

Regards,
Ben

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2007-12-12 23:13:07 Re: jdbc lob and postgresql
Previous Message D. Dante Lorenso 2007-12-12 21:59:14 Re: Extract last 4 characters from string?