I am working on a database operation, which produces a lot of inserts (~ 15,000,000).
I am currently using a temporary table for this data, because the data is no longer required after the operation. I recently found out, that unlogged tables have a better insert performance and hence I want to use it. But reading the documentation, it is not clear to me if temporary tables are already unlogged? And if they are not, is there a way to make them unlogged?
If I try to alter a temporary table like this:
alter table temp_table set unlogged;
I get the error: [42P16] ERROR: cannot change logged status of table "test" because it is temporary
Temporary tables are never WAL logged.
Since they will be gone with the database session, there is never a need to recover them.
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