4 ms·
> My gut feeling tells me that the chances of having an upstream library that contains the parser/parse analysis/planner are slim. Yea. The parser alone would
by anarazel 3y ago
> My gut feeling tells me that the chances of having an upstream library that contains the parser/parse analysis/planner are slim.
Yea. The parser alone would be doable and not even that hard. But once you get to parse analysis and planning, you need to access the catalogs (for parse analysis to look up object names and do permission checks, for planning to access operator definitions, statistics etc). Which in turn needs a lot of the catalog / relation cache infrastructure. By that point you've pulled in a lot of postgres.
Of course you could try to introduce a "data provider" layer between parse analysis and catalogs, but that'd be a lot of work. And it'd be quite hard to get right in places - e.g. doing name lookups without acquiring heavyweight locks on objects, before having done permission checks, in a concurrency safe way, relies on a bunch of subsystems working together.