From: | Jim Mlodgenski <jimmy76(at)gmail(dot)com> |
---|---|
To: | Julien Rouhaud <rjuju123(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Hook for extensible parsing. |
Date: | 2021-07-06 19:26:16 |
Message-ID: | CAB_5SRdvtdiz7ZG92-wDXN5qrvK7nmEPYsvmXhnLkkFTdh+ZaQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sat, Jun 12, 2021 at 4:29 AM Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote:
> I'd like to propose an alternative approach, which is to allow multiple parsers
> to coexist, and let third-party parsers optionally fallback on the core
> parsers. I'm sending this now as a follow-up of [1] and to avoid duplicated
> efforts, as multiple people are interested in that topic.
The patches all build properly and pass all regressions tests.
> pg_parse_query() will instruct plugins to parse a query at a time. They're
> free to ignore that mode if they want to implement the 3rd mode. If so, they
> should either return multiple RawStmt, a single RawStmt with a 0 or
> strlen(query_string) stmt_len, or error out. Otherwise, they will implement
> either mode 1 or 2, and they should always return a List containing a single
> RawStmt with properly set stmt_len, even if the underlying statement is NULL.
> This is required to properly skip valid strings that don't contain a
> statements, and pg_parse_query() will skip RawStmt that don't contain an
> underlying statement.
Wouldn't we want to only loop through the individual statements if parser_hook
exists? The current patch seems to go through the new code path regardless
of the hook being grabbed.
From | Date | Subject | |
---|---|---|---|
Next Message | Drouvot, Bertrand | 2021-07-06 19:33:35 | Re: visibility map corruption |
Previous Message | Daniel Gustafsson | 2021-07-06 19:08:53 | Re: proposal - log_full_scan |