Insert/Update/Delete views with INSTEAD OF - Mailing list pgsql-general

From Ben
Subject Insert/Update/Delete views with INSTEAD OF
Date
Msg-id 5f4a64610712121458gc26ef9fn48171dc1ef78b6cb@mail.gmail.com
Whole thread Raw
List 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

pgsql-general by date:

Previous
From: "D. Dante Lorenso"
Date:
Subject: Re: Extract last 4 characters from string?
Next
From: Thomas Kellerer
Date:
Subject: Re: jdbc lob and postgresql