Re: postgres_fdw versus regconfig and similar constants
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-07-01T20:47:00Z
Lists: pgsql-hackers
On Mon, May 16, 2022 at 1:33 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > 0001 deals with the lack-of-schema-qualification issue by forcing > search_path to be just "pg_catalog" while we're deparsing constants. > This seems straightforward, if annoyingly expensive, and it's enough > to fix the bug as presented. Yeah, that does seem like the thing to do. I doubt it will be the last problem setting we need to add to that list, either. It's kind of unfortunate that data type output formatting is context-dependent like this, but I don't have an idea. > 0002 tightens deparse.c's rules to only consider an OID alias constant > as shippable if the object it refers to is shippable. This seems > obvious in hindsight; I wonder how come we've not realized it before? > However, this has one rather nasty problem for regconfig in particular: > with our standard shippability rules none of the built-in text search > configurations would be treated as shippable, because initdb gives them > non-fixed OIDs above 9999. That seems like a performance hit we don't > want to take. In the attached, I hacked around that by making a special > exception for OIDs up to 16383, but that seems like a fairly ugly kluge. > Anybody have a better idea? No. It feels to me like there are not likely to be any really satisfying answers here. We have a way of mapping a given local table to a given foreign table, but to the best of my knowledge we have no similar mechanism for any other type of object. So it's just crude guesswork. Who is to say whether the fact that we have a local text search configuration means that there is a remote text search configuration with the same name, and even if yes, that it has the same semantics? And similarly for any other object types? Every release adds and occasionally removes SQL objects from the system catalogs, and depending on the object type, it can also vary by operating system. There are several multiple forks of PostgreSQL, too. > While using find_expr_references() as a reference for writing the new code > in 0002, I was dismayed to find that it omitted handling regcollation; > and a quick search showed that other places that specially process REG* > types hadn't been updated for that addition either. 0003 closes those > oversights. Makes sense. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
postgres_fdw: be more wary about shippability of reg* constants.
- 31e5b5029203 16.0 landed
-
Fix omissions in support for the "regcollation" type.
- f49a9fc2bb12 16.0 landed
- bb30410b9f4c 14.5 landed
- 96dbbf828c5f 15.0 landed
- 36ccca3dbac3 13.8 landed
-
postgres_fdw: set search_path to 'pg_catalog' while deparsing constants.
- 26c9e1bd8846 10.22 landed
- b8032f4816c3 15.0 landed
- 94bcb48ab53b 11.17 landed
- 810bcbd383ab 14.5 landed
- 6230bd7df4ce 13.8 landed
- 288e499ba817 12.12 landed
- 0a7ccee8fe9f 16.0 landed