Re: [PROPOSAL] comments in repl_scanner

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Matěj Klonfar <matej(dot)klonfar(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PROPOSAL] comments in repl_scanner
Date: 2025-10-16 08:29:06
Message-ID: e59a1a8b-d2a4-4991-9af0-db2a40695387@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14.10.25 13:13, Matěj Klonfar wrote:
> certain instrumentation tools do prefix each statement with an
> informational comment, typically to provide some tracing information to
> logs (datadog for example). While this works for SQL statements, it's
> not possible with logical replication statements because their grammar
> doesn't support comments and it is causing unnecessary syntax errors.
>
> I can imagine this limitation is likely a holdover from the system's
> evolution from physical replication where comments make no sense.
> However, in logical replication walsender mode both SQL and replication
> statements can be issued [1], so the current state brings the necessity
> to distinguish when to inject the comment and when not to. What do you
> feel, are there any unexpected impacts of extending the replication
> grammar with comments?

Another approach could be to get rid of repl_scanner.l and use the main
scanner. This would be similar to how plpgsql works.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Akshay Joshi 2025-10-16 08:34:21 Re: [PATCH] Add pg_get_policy_ddl() function to reconstruct CREATE POLICY statement
Previous Message Bertrand Drouvot 2025-10-16 08:23:37 Re: Question about InvalidatePossiblyObsoleteSlot()