Re: Add constraint in a Materialized View

Lists: pgsql-hackers
From: Kaye Ann Ignacio <kaye(dot)ignacio(at)proceedit(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Add constraint in a Materialized View
Date: 2018-07-18 07:28:19
Message-ID: CAHzfm1D2s+P+DqEyZALvg-cNaH7q1NDBUOtBCF+8S_B3u-o_Fg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

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(dot)ignacio(at)proceedit(dot)com +34 679188011 (mobile)


From: Nico Williams <nico(at)cryptonector(dot)com>
To: Kaye Ann Ignacio <kaye(dot)ignacio(at)proceedit(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add constraint in a Materialized View
Date: 2018-07-20 19:06:47
Message-ID: 20180720190646.GS9712@localhost
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

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
--