Re: [PATCH] postgres_fdw: suppress explicit casts in text:text comparisons (was: column option to override foreign types)

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Dian M Fay" <dian.m.fay@gmail.com>
Cc: "David Steele" <david@pgmasters.net>, "Georgios Kokolatos" <gkokolatos@protonmail.com>, "PostgreSQL Developers" <pgsql-hackers@lists.postgresql.org>
Date: 2021-11-12T16:54:20Z
Lists: pgsql-hackers
"Dian M Fay" <dian.m.fay@gmail.com> writes:
> Eminently reasonable all around! `git apply` insisted that the v8 patch
> didn't (apply, that is), but `patch -p1` liked it fine. I've put it
> through a few paces and it seems good; what needs to happen next?

I don't see anything else to do except shove it out into the light
of day and see what happens.  Hence, pushed.

As I remarked in the commit message:

>> One point that I (tgl) remain slightly uncomfortable with is that we
>> will ignore an implicit RelabelType when deciding if the non-Const input
>> is a plain Var.  That makes it a little squishy to argue that the remote
>> should resolve the Const as being of the same type as its Var, because
>> then our Const is not the same type as our Var.  However, if we don't do
>> that, then this hack won't work as desired if the user chooses to use
>> varchar rather than text to represent some remote column.  That seems
>> useful, so do it like this for now.  We might have to give up the
>> RelabelType-ignoring bit if any problems surface.

I think we can await complaints before doing more, but I wanted that
bit on record for anyone perusing the archives.

			regards, tom lane



Commits

  1. postgres_fdw: suppress casts on constants in limited cases.