pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Detecting schema changes via WAL logs
2+ messages / 2 participants
[nested] [flat]

* Detecting schema changes via WAL logs
@ 2022-02-19 16:42  Cal Mitchell <cmitch29@sqlpipe.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Cal Mitchell @ 2022-02-19 16:42 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

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.=

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Detecting schema changes via WAL logs
@ 2022-02-21 10:20  Tomas Pospisek <tpo2@sourcepole.ch>
  parent: Cal Mitchell <cmitch29@sqlpipe.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tomas Pospisek @ 2022-02-21 10:20 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 19.02.22 17:42, Cal Mitchell wrote:
> 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.

I remember having seen a similar question recently here - that is 
detecting schema changes.

Also I think having seen WAL to SQL scripts somewhere.

I might be wrong on both accounts, but maybe you want to review the last 
few months of list archives if you haven't done so already and maybe 
check postgres' Debian package repository if there aren't WAL to SQL 
scripts somewhere.

As I said, this is what my fuzzy in-brain SQL returns so please don't 
SIGKILL me if my query was too fuzzy indeen.
*t





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2022-02-21 10:20 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-02-19 16:42 Detecting schema changes via WAL logs Cal Mitchell <cmitch29@sqlpipe.com>
2022-02-21 10:20 ` Tomas Pospisek <tpo2@sourcepole.ch>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox