Delete query on materialized view - Mailing list pgsql-hackers

From hari.prasath
Subject Delete query on materialized view
Date
Msg-id 15480e63fa8.ace8de5020207.5799321620874528713@zohocorp.com
Whole thread Raw
List pgsql-hackers
Hi all
      I am trying to delete/insert a row on materialized view which has join from a UDF by using SPI_execute.
      
      Materialized views are not allowed to do any DML changes once created,so by bypassed that check by enabling MatViewIncrementalMaintenanceIsEnabled. so DML queries can be executed in MV. But i dont want to bypass that check i tried to change the relkind for the materialized view to 'r' (normal table relation) in pg_class table and tried the same query but its throwing an error.

## ERROR:  could not find attribute -1 in subquery targetlist ##


Is there a way to enable DML queries on materialized views which has join without overwriting matview_maintenance_depth to 1 as the method was local in matview.c?



cheers
- Harry

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pg_dump vs. TRANSFORMs
Next
From: Kevin Grittner
Date:
Subject: Re: what to revert