Re: [PATCH] postgres-fdw: column option to override foreign types

From: Georgios Kokolatos <gkokolatos(at)protonmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Dian Fay <dian(dot)m(dot)fay(at)gmail(dot)com>
Subject: Re: [PATCH] postgres-fdw: column option to override foreign types
Date: 2021-03-04 14:28:46
Message-ID: 161486812679.29968.811913066853626959.pgcf@coridan.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The following review has been posted through the commitfest application:
make installcheck-world: not tested
Implements feature: not tested
Spec compliant: not tested
Documentation: not tested

Hi,

Thanks for the patch.

I am afraid I will have to :-1: this patch. Of course it is possible that I am wrong,
so please correct me if you, or any other reviewers, think so.

The problem that is intended to be solved, upon closer inspection seems to be a
conscious design decision rather than a problem. Even if I am wrong there, I am
not certain that the proposed patch covers all the bases with respect to collations,
build-in types, shipability etc for simple expressions, and covers any of more
complicated expressions all together.

As for the scenario which prompted the patch, you wrote, quote:

The real scenario that prompted it is a
tickets table with status, priority, category, etc. enums. We don't have
plans to modify them any time soon, but if we do it's got to be
coordinated and deployed across two databases, all so we can use what
might as well be a text column in a single WHERE clause. Since foreign
tables can be defined over subsets of columns, reordered, and names
changed, a little opt-in flexibility with types too doesn't seem
misplaced.

end quote.

I will add that creating a view on the remote server with type flexibility that
you wish and then create foreign tables against the view, might address your
problem.

Respectfully,
//Georgios

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-03-04 14:33:25 Re: Track replica origin progress for Rollback Prepared
Previous Message Alvaro Herrera 2021-03-04 14:26:27 Re: [HACKERS] PATCH: Batch/pipelining support for libpq