Delete query on materialized view

From: "hari(dot)prasath" <hari(dot)prasath(at)zohocorp(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Delete query on materialized view
Date: 2016-05-05 12:30:53
Message-ID: 15480e63fa8.ace8de5020207.5799321620874528713@zohocorp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2016-05-05 12:49:12 Re: what to revert
Previous Message Peter Eisentraut 2016-05-05 12:28:27 Re: pg_dump vs. TRANSFORMs