All of the shared memory settings and the starting client settings for the database are stored in the postgresql.conf file. In earlier versions, you had to know the unit for each memory related setting: some were in units of 1K, some 8K, it was difficult to keep track of. Nowadays, you can still set values like that, but the preferred practice is to use a memory size instead. For example, if you wanted to set the wal_buffers value that controls how much memory to use for buffering write-ahead log data, you can do that now with a line like this in the postgresql.conf file:
shared_buffers = 128MB # min 128kB
If you use the SHOW command to display the value for this setting, it will write it similarly (although it's possible the value will get rescaled to display better). But the database still converts this value into its own internal units, which for this parameter happens to be 8K blocks. It's helpful to be aware of this because you'll need to know the actual values to understand some of the internal information covered in this chapter. Like shared_buffer, there are other memory configuration settings, for example, work_mem, maintenance_work_mem, autovacuum_work_mem, and dynamic_shared_memory_type. Details of each and every configuration will be covered later in this book.
The pg_settings view in the database can be used to see how that conversion happens. It's also helpful to know that the current_setting() function can be used to get the same basic information as SHOW, but in a way you can use in queries. You can combine these two to help see the relationship between the internal way the server stores parameters and what they actually represent:
