From: | Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> |
---|---|
To: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | handling of heap rewrites in logical decoding |
Date: | 2018-02-25 01:57:30 |
Message-ID: | 2186bfbb-56b1-a3f0-fda7-5a2eff25f5dd@2ndquadrant.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
A heap rewrite during a DDL command publishes changes for relations
named like pg_temp_%u, which are not real tables, and this breaks
replication systems that are not aware of that. We have a hack in the
pgoutput plugin to ignore those, but we knew that was a hack. So here
is an attempt at a more proper solution: Store a relisrewrite column in
pg_class and filter on that.
I have put this into reorderbuffer.c, so that it affects all plugins.
An alternative would be to have each plugin handle it separately (the
way it is done now), but it's hard to see why a plugin would not want
this fixed behavior.
A more fancy solution would be to make this column an OID that links
back to the original table. Then, a DDL-aware plugin could choose
replicate the rewrite rows. However, at the moment no plugin works that
way, so this might be overdoing it.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Attachment | Content-Type | Size |
---|---|---|
0001-Handle-heap-rewrites-even-better-in-logical-decoding.patch | text/plain | 34.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2018-02-25 02:27:41 | remove pg_class.relhaspkey |
Previous Message | Tomas Vondra | 2018-02-25 00:30:47 | Re: WIP: BRIN multi-range indexes |