Odd oid-system-column handling in postgres_fdw

Started by Etsuro Fujitaabout 10 years ago6 messageshackers
Jump to latest
#1Etsuro Fujita
fujita.etsuro@lab.ntt.co.jp

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

Attachments:

postgres-fdw-oid-support.patchapplication/x-patch; name=postgres-fdw-oid-support.patchDownload+68-31
#2Etsuro Fujita
fujita.etsuro@lab.ntt.co.jp
In reply to: Etsuro Fujita (#1)
Re: Odd oid-system-column handling in postgres_fdw

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]/messages/by-id/57035DFC.3050802@lab.ntt.co.jp 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]/messages/by-id/57035DFC.3050802@lab.ntt.co.jp.

Best regards,
Etsuro Fujita

[1]: /messages/by-id/57035DFC.3050802@lab.ntt.co.jp

Attachments:

postgres-fdw-oid-support-v2.patchtext/x-patch; name=postgres-fdw-oid-support-v2.patchDownload+72-30
#3Etsuro Fujita
fujita.etsuro@lab.ntt.co.jp
In reply to: Etsuro Fujita (#2)
Re: Odd oid-system-column handling in postgres_fdw

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Robert Haas
robertmhaas@gmail.com
In reply to: Etsuro Fujita (#3)
Re: Odd oid-system-column handling in postgres_fdw

On Wed, May 11, 2016 at 3:44 AM, Etsuro Fujita
<fujita.etsuro@lab.ntt.co.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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Etsuro Fujita (#2)
Re: Odd oid-system-column handling in postgres_fdw

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#6Etsuro Fujita
fujita.etsuro@lab.ntt.co.jp
In reply to: Heikki Linnakangas (#5)
Re: Odd oid-system-column handling in postgres_fdw

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers