Re: [PROPOSAL] comments in repl_scanner - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [PROPOSAL] comments in repl_scanner
Date
Msg-id e59a1a8b-d2a4-4991-9af0-db2a40695387@eisentraut.org
Whole thread Raw
In response to [PROPOSAL] comments in repl_scanner  (Matěj Klonfar <matej.klonfar@gmail.com>)
List 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.




pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Question about InvalidatePossiblyObsoleteSlot()
Next
From: Akshay Joshi
Date:
Subject: Re: [PATCH] Add pg_get_policy_ddl() function to reconstruct CREATE POLICY statement