Re: Updating MATERIALIZED VIEWs (Re: [HACKERS] delta relations inAFTER triggers) - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: Updating MATERIALIZED VIEWs (Re: [HACKERS] delta relations inAFTER triggers)
Date
Msg-id 2016db76-02ba-7cc3-ae4e-47e25f967663@BlueTreble.com
Whole thread Raw
In response to Re: delta relations in AFTER triggers  (Kevin Grittner <kgrittn@gmail.com>)
List pgsql-hackers
On 1/20/17 5:38 PM, Nico Williams wrote:
> If these triggers could be automatically generated, that sure would be
> nice, but some control would be needed over when to update the MV vs.
> mark it as needing a refresh.

FWIW, pg_classy[1], which is still a work in progress, would allow for 
that. The idea is that you define a code template which you can then 
call with arguments (such as the name of a matview table), and those 
arguments get put into the template before executing the resulting SQL.

Most of the basic framework for that is in place; I just need to finish 
code that will allow for the extension to track arbitrary database 
objects that were created.

1: https://github.com/decibel/pg_classy/blob/master/doc/pg_classy.asc
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [HACKERS] Checksums by default?
Next
From: Stephen Frost
Date:
Subject: Re: [HACKERS] Checksums by default?