Detecting schema changes via WAL logs

From: Cal Mitchell <cmitch29(at)sqlpipe(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Detecting schema changes via WAL logs
Date: 2022-02-19 16:42:51
Message-ID: C90BBBF0-F41A-43D0-8988-E4964B31D75F@sqlpipe.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello everyone,

I’m building an open-source data integration tool (SQLpipe) and am now trying to incorporate CDC into the product.

Is it possible to detect when schema changes happen via the WAL? The WAL doesn’t have to tell me what was changed, it just needs to tell me when something changed.

For example, anytime I run create table or some other DDL command, there is a begin and commit message in the log, with nothing in between. If there aren’t any other operations that create such “empty” logs, it seems possible to just re-scan the tables that are being synced for schema changes whenever one of these logs is encountered.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carsten Klein 2022-02-19 19:00:06 Re: Strange results when casting string to double
Previous Message Merlin Moncure 2022-02-19 15:38:41 Re: Strange results when casting string to double