Odd oid-system-column handling in postgres_fdw

Lists: pgsql-hackers
From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Odd oid-system-column handling in postgres_fdw
Date: 2016-03-16 07:25:42
Message-ID: 56E90A76.5000503@lab.ntt.co.jp
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

PG9.5 allows us to add an oid system column to foreign tables, using
ALTER FOREIGN TABLE SET WITH OIDS, but currently, that column reads as
zeroes in postgres_fdw. That seems to me like a bug. So, I'd like to
propose to fix that, by retrieving that column from the remote server
when requested. I'm attaching a proposed patch for that.

Best regards,
Etsuro Fujita

Attachment Content-Type Size
postgres-fdw-oid-support.patch application/x-patch 5.3 KB

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Odd oid-system-column handling in postgres_fdw
Date: 2016-04-05 08:15:22
Message-ID: 5703741A.9090402@lab.ntt.co.jp
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On 2016/03/16 16:25, Etsuro Fujita wrote:
> PG9.5 allows us to add an oid system column to foreign tables, using
> ALTER FOREIGN TABLE SET WITH OIDS, but currently, that column reads as
> zeroes in postgres_fdw. That seems to me like a bug. So, I'd like to
> propose to fix that, by retrieving that column from the remote server
> when requested. I'm attaching a proposed patch for that.

I rebased the patch against HEAD. Updated patch attached. I don't
think this is a 9.6 issue, but I think this is somewhat related to the
9.6 issue [1] that postgres_fdw join pushdown incorrectly retrieves
system columns other than ctid and oid from the remote server, so ISTM
that it's better to address this in conjunction with [1].

Best regards,
Etsuro Fujita

[1] http://www.postgresql.org/message-id/57035DFC.3050802@lab.ntt.co.jp

Attachment Content-Type Size
postgres-fdw-oid-support-v2.patch text/x-patch 7.2 KB

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Odd oid-system-column handling in postgres_fdw
Date: 2016-05-11 07:44:27
Message-ID: 7368f1e7-c8a8-1677-0c6f-fe4988256bab@lab.ntt.co.jp
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On 2016/04/05 17:15, Etsuro Fujita wrote:
> On 2016/03/16 16:25, Etsuro Fujita wrote:
>> PG9.5 allows us to add an oid system column to foreign tables, using
>> ALTER FOREIGN TABLE SET WITH OIDS, but currently, that column reads as
>> zeroes in postgres_fdw. That seems to me like a bug. So, I'd like to
>> propose to fix that, by retrieving that column from the remote server
>> when requested. I'm attaching a proposed patch for that.

> I rebased the patch against HEAD. Updated patch attached.

I'll add this to the next CF.

Best regards,
Etsuro Fujita


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Odd oid-system-column handling in postgres_fdw
Date: 2016-05-16 15:26:28
Message-ID: CA+TgmoazjErU49GtxjR9Sj7kSm+tTsUAFgOqg2Et1fAZCmKdpQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, May 11, 2016 at 3:44 AM, Etsuro Fujita
<fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> I'll add this to the next CF.

Makes sense. I think this is basically a new feature, so let's treat
it that way.

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


From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Odd oid-system-column handling in postgres_fdw
Date: 2016-08-26 13:35:59
Message-ID: 6fcc5bac-cafe-bd60-9f9c-be1cc81bd46e@iki.fi
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On 04/05/2016 11:15 AM, Etsuro Fujita wrote:
> On 2016/03/16 16:25, Etsuro Fujita wrote:
>> PG9.5 allows us to add an oid system column to foreign tables, using
>> ALTER FOREIGN TABLE SET WITH OIDS, but currently, that column reads as
>> zeroes in postgres_fdw. That seems to me like a bug. So, I'd like to
>> propose to fix that, by retrieving that column from the remote server
>> when requested. I'm attaching a proposed patch for that.
>
> I rebased the patch against HEAD. Updated patch attached.

Committed, thanks!

- Heikki


From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Odd oid-system-column handling in postgres_fdw
Date: 2016-08-30 01:55:28
Message-ID: ba6ea8c0-9daa-87e2-5770-8c0af300e703@lab.ntt.co.jp
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On 2016/08/26 22:35, Heikki Linnakangas wrote:
> On 04/05/2016 11:15 AM, Etsuro Fujita wrote:
>> On 2016/03/16 16:25, Etsuro Fujita wrote:
>>> PG9.5 allows us to add an oid system column to foreign tables, using
>>> ALTER FOREIGN TABLE SET WITH OIDS, but currently, that column reads as
>>> zeroes in postgres_fdw. That seems to me like a bug. So, I'd like to
>>> propose to fix that, by retrieving that column from the remote server
>>> when requested. I'm attaching a proposed patch for that.

>> I rebased the patch against HEAD. Updated patch attached.

> Committed, thanks!

Thank you for taking the time to commit this patch!

Best regards,
Etsuro Fujita