If I create a temporary table inside of a transaction, populate it with the COPY command, and use the ON COMMIT DROP option, does the table data still get written to the WAL and get replicated to the slave database? I'm doing a fairly large import, doing some work using that data, and then I don't need it anymore. I don't want to rollback the whole transaction because I want to keep the work that was done using the source data, but I won't need the source data again and so I don't want to waste time and bandwidth replicating and deleting it on the slave.
Temporary tables are not WAL-logged in PostgreSQL.
You might be interested in this article by Robert Haas (PostgreSQL core developer) about unlogged tables - that also clarifies the behavior of temporary tables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With