Re: Automatically Creating INSERT/UPDATE/DELETE Rules on Views - Mailing list pgsql-general

From Robert Treat
Subject Re: Automatically Creating INSERT/UPDATE/DELETE Rules on Views
Date
Msg-id 200611112306.03341.xzilla@users.sourceforge.net
Whole thread Raw
In response to Automatically Creating INSERT/UPDATE/DELETE Rules on Views  ("Matt Miller" <pgsql@mattmillersf.fastmail.fm>)
List pgsql-general
On Friday 10 November 2006 18:39, Matt Miller wrote:
> I'm converting a large Oracle DB that uses hundreds of updatable views.
> ora2pg is quite useful, but it looks like it doesn't do anything to
> create the rules that are needed to make the views updatable.  Under
> Oracle simple views like "select * from the_table" are automatically
> updatable, so the Oracle schema doesn't have any triggers or the like
> that I could import as PG rules.
>

You might be able to use the information in pg_depend to write a script to
generate the rules for any view that only has a single table in it's
dependency tree.  (I've really no idea if this would work, so if you try it
and it succeeds please post a note or some code back to the group!)

--
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL

pgsql-general by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: Why overlaps is not working
Next
From: Robert Treat
Date:
Subject: Re: Using GIN indexes on 8.2