On Wed, Apr 29, 2026 at 1:25 AM Hannu Krosing <hannuk@google.com> wrote:
>
> My high-level understanding is, that we should first clearly answer these two questions
>
> 1. What does Logical Decodng infrastructure make available to the decoding plugin call-backs
>
> 2. What the callbacks themselves do in case of DDL
Yeah that makes sense, Hannu.
> My answer to the 1. is "everything, as it should be the plugin that decides what it needs". It does not mean that we
shouldalways prepack everything with special logical decoding structures, but there should be a way to get at anything
thatis available in the WAL at least. The result is in WAL, and for DDL it is also in the system tables themselves, in
propertime-travel way.
>
> For 2. I would prefer to "deparse" the DDL from actual system tables at that snapshot. In logical decoding the system
tablesare special in that we keep the actual table content and have real time travel capabilities on them. This should
allowus to use the code we already have in pg_dump for extracting the "status quo DDL" meaning the DDL for creating
everythingfrom scratch. The main thing missing is DDL for ALTER and DROP which would need to be added. But that too
shouldbe in the plugin, not in the DDL side .
I am trying to understand your idea. If we are trying to deparse from
an actual system table using a snapshot, why don't we just use the
WAL? I mean, the WAL should contain the actual catalog modifications
it has made. Although converting the catalog changes into a deparse
representation of the DDL could be complex no? Another question is
what we would do with those deparsed representations: will we convert
them to SQL on the subscriber and execute, or do something else?
--
Regards,
Dilip Kumar
Google