I've set up a couple of (logical) replicated tables between two postgres instances. All SELECT, INSERT, UPDATE, DELETE Transactions are replicated as expected.
My use case is to restore/append a couple of thousands of rows out of a logical dump file (custom format, COPY or INSERT?)
TRUNCATE is not replicated...in my understanding (which also relies on the knowledge how other commercial DB vendors do it) because it bypasses the transaction log which is needed by the replication mechanism (this would be another question, if logical replication relies on WAL segments?)
As I cannot find any documentation about it, I would like to know if:
- COPY bypasses the transaction log (WAL)?
- COPY has any restrictions on logical replication so that in fact the use of INSERTs is mandatory in replicated environments?
P.S. Sorry if I am mixing up things here, I really would like to clear these topics up to better understand how they are working together