>From 16d9a659b9bdf29f1fead13d99085697ba83c6f3 Mon Sep 17 00:00:00 2001
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Thu, 7 Nov 2013 09:46:11 -0300
Subject: [PATCH 04/36] deparse/core: return OID of matview in REFRESH

For future consumption by event triggers
---
 src/backend/commands/matview.c | 4 +++-
 src/include/commands/matview.h | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/backend/commands/matview.c b/src/backend/commands/matview.c
index 5130d51..1e26fa9 100644
--- a/src/backend/commands/matview.c
+++ b/src/backend/commands/matview.c
@@ -132,7 +132,7 @@ SetMatViewPopulatedState(Relation relation, bool newstate)
  * The matview's "populated" state is changed based on whether the contents
  * reflect the result set of the materialized view's query.
  */
-void
+Oid
 ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
 				   ParamListInfo params, char *completionTag)
 {
@@ -274,6 +274,8 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
 	}
 	else
 		refresh_by_heap_swap(matviewOid, OIDNewHeap);
+
+	return matviewOid;
 }
 
 /*
diff --git a/src/include/commands/matview.h b/src/include/commands/matview.h
index 476b285..2c468b2 100644
--- a/src/include/commands/matview.h
+++ b/src/include/commands/matview.h
@@ -22,7 +22,7 @@
 
 extern void SetMatViewPopulatedState(Relation relation, bool newstate);
 
-extern void ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
+extern Oid ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
 				   ParamListInfo params, char *completionTag);
 
 extern DestReceiver *CreateTransientRelDestReceiver(Oid oid);
-- 
1.9.1

