PostgreSQL – Max Damage from an Unlogged Table

postgresql

If my database goes down (let's say memory maxed out) while i'm creating an unlogged table, is the damage limited to just losing that unlogged table or could it prevent recovery of the rest of the database?

Best Answer

While operations on the data in an unlogged table are unlogged the creation of the unlogged table is actually logged as this is an operation on the system catalog. Thus normal recovery would happen. So depending on how far it actually was it would complete creation of the table or discard the action during recovery.