Add constraint in a Materialized View

Started by Kaye Ann Ignacioover 7 years ago2 messages
#1Kaye Ann Ignacio
kaye.ignacio@proceedit.com

Hi,

I'm trying to add a foreign constraint in my local table to reference a
column in a materialized view, is it possible to alter this materialized
view by adding a primary key constraint?

Thank you.

--
Kaye Ann Ignacio, Programmer
proceedit "the BPaaS company"
kaye.ignacio@proceedit.com +34 679188011 (mobile)

#2Nico Williams
nico@cryptonector.com
In reply to: Kaye Ann Ignacio (#1)
Re: Add constraint in a Materialized View

On Wed, Jul 18, 2018 at 09:28:19AM +0200, Kaye Ann Ignacio wrote:

I'm trying to add a foreign constraint in my local table to reference a
column in a materialized view, is it possible to alter this materialized
view by adding a primary key constraint?

It's not, but I'm working on a patch for that and much more. Basically,
I want to integrate something like
https://github.com/twosigma/postgresql-contrib/blob/master/mat_views.sql

I currently use that code instead of PG native materialized views.

Nico
--