Re: Foreign tables don't enforce the partition constraint - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Foreign tables don't enforce the partition constraint
Date
Msg-id CA+TgmoZKkvC0rTK5EG0j=5g7RiwrQAihvGhBoNM_NqwzGseN_Q@mail.gmail.com
Whole thread Raw
Responses Re: Foreign tables don't enforce the partition constraint  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
List pgsql-hackers
On Fri, Mar 31, 2017 at 5:11 AM, Ashutosh Bapat
<ashutosh.bapat@enterprisedb.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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Partitioning vs ON CONFLICT
Next
From: Peter Geoghegan
Date:
Subject: Re: Partitioning vs ON CONFLICT