Re: Foreign tables don't enforce the partition constraint

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Foreign tables don't enforce the partition constraint
Date: 2017-03-31 20:57:53
Message-ID: CA+TgmoZKkvC0rTK5EG0j=5g7RiwrQAihvGhBoNM_NqwzGseN_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 31, 2017 at 5:11 AM, Ashutosh Bapat
<ashutosh(dot)bapat(at)enterprisedb(dot)com> wrote:
> Per https://www.postgresql.org/docs/devel/static/sql-createforeigntable.html,
> constraints on the foreign table should represent a constraint that is
> being enforced by the remote server.

Right. This is user error. Having the *local* server try to enforce
the constraint would slow down the system without guaranteeing
anything, because somebody could modify the table on the remote server
directly.

> Similarly, a partition constraint
> should also be enforced at the foreign server. Probably we should
> update documentation of create foreign table to mention this.

That is a good idea.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-03-31 21:24:02 Re: REFERENCES privilege should not be symmetric (was Re: [GENERAL] Postgres Permissions Article)
Previous Message Robert Haas 2017-03-31 20:47:28 Re: Partitioning vs ON CONFLICT