Re: [HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-28 Thread Robert Haas
On Thu, Mar 17, 2016 at 2:26 AM, Ashutosh Bapat wrote: > On Wed, Mar 16, 2016 at 10:22 PM, Tom Lane wrote: >> Robert Haas writes: >> > On Wed, Mar 16, 2016 at 4:10 AM, Ashutosh Bapat < >> > ashutosh.ba...@enterprisedb.com> wrote: >> >> In 9.5, postgres_fdw allowed to prepare statements involving

Re: [HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-19 Thread Ashutosh Bapat
On Wed, Mar 16, 2016 at 10:22 PM, Tom Lane wrote: > Robert Haas writes: > > On Wed, Mar 16, 2016 at 4:10 AM, Ashutosh Bapat < > > ashutosh.ba...@enterprisedb.com> wrote: > >> In 9.5, postgres_fdw allowed to prepare statements involving foreign > >> tables without an associated user mapping as lo

Re: [HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-19 Thread Robert Haas
On Wed, Mar 16, 2016 at 4:10 AM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > > Now what's going on here? It seems to me that either postgres_fdw >> requires a user mapping (in which case this ought to fail) or it >> doesn't (in which case this ought to push the join down). I don't

Re: [HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-19 Thread Tom Lane
Robert Haas writes: > On Wed, Mar 16, 2016 at 4:10 AM, Ashutosh Bapat < > ashutosh.ba...@enterprisedb.com> wrote: >> In 9.5, postgres_fdw allowed to prepare statements involving foreign >> tables without an associated user mapping as long as planning did not >> require the user mapping. Remember,

Re: [HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-16 Thread Ashutosh Bapat
On Wed, Mar 16, 2016 at 2:14 AM, Robert Haas wrote: > On Tue, Mar 15, 2016 at 6:44 AM, Ashutosh Bapat > wrote: > > Here's patch which fixes the issue using Robert's idea. > > Please at least check your patches with 'git diff --check' Thanks. > before > submitting them. And where it's not to

Re: [HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-15 Thread Robert Haas
On Tue, Mar 15, 2016 at 6:44 AM, Ashutosh Bapat wrote: > Here's patch which fixes the issue using Robert's idea. Please at least check your patches with 'git diff --check' before submitting them. And where it's not too much trouble, pgindent them. Or at least make them look something like what p

Re: [HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-15 Thread Ashutosh Bapat
Here's patch which fixes the issue using Robert's idea. On Mon, Mar 14, 2016 at 10:53 PM, Robert Haas wrote: > On Mon, Mar 14, 2016 at 1:05 PM, Tom Lane wrote: > > Robert Haas writes: > >> On Sun, Mar 13, 2016 at 10:51 PM, Tom Lane wrote: > >>> I'm not really sold on enforcing that people cre

Re: [HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-14 Thread Robert Haas
On Mon, Mar 14, 2016 at 1:05 PM, Tom Lane wrote: > Robert Haas writes: >> On Sun, Mar 13, 2016 at 10:51 PM, Tom Lane wrote: >>> I'm not really sold on enforcing that people create meaningless user >>> mappings. For one thing, they're likely to be sloppy about it, which >>> could lead to latent

Re: [HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-14 Thread Tom Lane
Robert Haas writes: > On Sun, Mar 13, 2016 at 10:51 PM, Tom Lane wrote: >> I'm not really sold on enforcing that people create meaningless user >> mappings. For one thing, they're likely to be sloppy about it, which >> could lead to latent security problems if the FDW later acquires a >> concept

Re: [HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-14 Thread Robert Haas
On Sun, Mar 13, 2016 at 10:51 PM, Tom Lane wrote: > Etsuro Fujita writes: >> On 2016/03/13 4:46, Andres Freund wrote: >>> ... The difference apears to be the >>> check that's now in build_simple_rel() - there was nothing hitting the >>> user mapping code before for file_fdw. > >> Exactly. > >> I'

Re: [HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-14 Thread Ashutosh Bapat
On Mon, Mar 14, 2016 at 8:21 AM, Tom Lane wrote: > Etsuro Fujita writes: > > On 2016/03/13 4:46, Andres Freund wrote: > >> ... The difference apears to be the > >> check that's now in build_simple_rel() - there was nothing hitting the > >> user mapping code before for file_fdw. > > > Exactly. >

Re: [HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-13 Thread Etsuro Fujita
On 2016/03/14 11:51, Tom Lane wrote: > Etsuro Fujita writes: >> On 2016/03/13 4:46, Andres Freund wrote: >>> ... The difference apears to be the >>> check that's now in build_simple_rel() - there was nothing hitting the >>> user mapping code before for file_fdw. >> Exactly. >> I'm not sure it's

Re: [HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-13 Thread Tom Lane
Etsuro Fujita writes: > On 2016/03/13 4:46, Andres Freund wrote: >> ... The difference apears to be the >> check that's now in build_simple_rel() - there was nothing hitting the >> user mapping code before for file_fdw. > Exactly. > I'm not sure it's worth complicating the code to keep that beha

Re: [HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-13 Thread Etsuro Fujita
Hi, On 2016/03/13 4:46, Andres Freund wrote: On 2016-03-12 11:56:24 -0500, Robert Haas wrote: On Fri, Mar 11, 2016 at 10:15 PM, Andres Freund wrote: On 2016-01-28 19:09:01 +, Robert Haas wrote: Only try to push down foreign joins if the user mapping OIDs match. Previously, the foreign j

[HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-12 Thread Andres Freund
Hi, On 2016-03-12 11:56:24 -0500, Robert Haas wrote: > On Fri, Mar 11, 2016 at 10:15 PM, Andres Freund wrote: > > On 2016-01-28 19:09:01 +, Robert Haas wrote: > >> Only try to push down foreign joins if the user mapping OIDs match. > >> > >> Previously, the foreign join pushdown infrastructur

[HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-12 Thread Robert Haas
On Fri, Mar 11, 2016 at 10:15 PM, Andres Freund wrote: > On 2016-01-28 19:09:01 +, Robert Haas wrote: >> Only try to push down foreign joins if the user mapping OIDs match. >> >> Previously, the foreign join pushdown infrastructure left the question >> of security entirely up to individual FDW

[HACKERS] Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat

2016-03-11 Thread Andres Freund
Hi, On 2016-01-28 19:09:01 +, Robert Haas wrote: > Only try to push down foreign joins if the user mapping OIDs match. > > Previously, the foreign join pushdown infrastructure left the question > of security entirely up to individual FDWs, but it would be easy for > a foreign data wrapper to