Re: [HACKERS] Foreign tables don't enforce the partition constraint

2017-04-06 Thread Amit Langote
On 2017/04/03 16:44, Amit Langote wrote: > Hi Ashutosh, > > On 2017/04/03 15:49, Ashutosh Bapat wrote: 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

Re: [HACKERS] Foreign tables don't enforce the partition constraint

2017-04-03 Thread Amit Langote
Hi Ashutosh, On 2017/04/03 15:49, Ashutosh Bapat wrote: >>> 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. >> >> Here's the patch. Thanks for

Re: [HACKERS] Foreign tables don't enforce the partition constraint

2017-04-03 Thread Ashutosh Bapat
> > 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. > > Here's the patch. I am not able to build documents on my laptop because of recent changes in

Re: [HACKERS] Foreign tables don't enforce the partition constraint

2017-03-31 Thread Robert Haas
On Fri, Mar 31, 2017 at 5:11 AM, Ashutosh Bapat 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

Re: [HACKERS] Foreign tables don't enforce the partition constraint

2017-03-31 Thread Ashutosh Bapat
On Fri, Mar 31, 2017 at 1:36 PM, Amit Langote wrote: > We don't enforce the constraints defined on foreign tables in ExecInsert() > and ExecUpdate(). (COPY FROM does not support foreign tables at all.) > Since partition constraints are enforced using

[HACKERS] Foreign tables don't enforce the partition constraint

2017-03-31 Thread Amit Langote
We don't enforce the constraints defined on foreign tables in ExecInsert() and ExecUpdate(). (COPY FROM does not support foreign tables at all.) Since partition constraints are enforced using ExecConstraints() which is not called for foreign tables, they will not be checked if one inserts