As Jan mentioned in his thread about a pluggable wire protocol [0], AWS is working on a set of extensions for Babelfish. The intention is to not necessarily have it as a single monolithic extension, but be possible for people to use pieces of it as they need when they are migrating to PostgreSQL. Some may just need the functions or data types. Others may need the stored procedure language. Many times when enterprises are migrating databases, they have satellite applications that they may not be able to change or they are on a different schedules than the main application so the database still needs to support some of the old syntax. A common need in these situations is the parser.
Attached is a patch to place a hook at the top of the parser to allow for a pluggable parser. It is modeled after the planner_hook [1]. To test the hook, I have also attached a simple proof of concept that wraps the parser in a TRY/CATCH block to catch any parse errors. That could potentially help a class of users who are sensitive to parse errors ending up in the logs and leaking PII data or passwords. -- Jim -- Amazon Web Services [0] - https://www.postgresql.org/message-id/flat/CAGBW59d5SjLyJLt-jwNv%2BoP6esbD8SCB%3D%3D%3D11WVe5%3DdOHLQ5wQ%40mail.gmail.com [1] - https://www.postgresql.org/message-id/flat/27516.1180053940%40sss.pgh.pa.us
parser_hook.patch
Description: Binary data
quiet_parser.c
Description: Binary data