To clarify Colinβs answer, almost everything goes through a recording journal. This is a block level log that records every record that will be made in any database structure. Each change in any part of the data catalog is first written to the WAL. This is because the main purpose of the WAL is to allow repeat changes if the system crashes or loses power, so it needs to burn every single scheduled disk.
PostgreSQL tables, views, etc. - these are just entries in the system catalog tables. Changes to these directories are written to the record along with everything else. The same applies to creating a database; db is just an entry in pg_database and the corresponding directory structure.
Change tables made by VACUUM , CLUSTER , TRUNCATE , etc .; they all go through the WAL, either with a record of the change in the block level, or using special WAL records to describe the operation.
Only a few short-lived things do not go through the WAL, for example:
- changes to
UNLOGGED and TEMPORARY tables - Temp files for sorting to disk
source share