October 2014
Intermediate to advanced
142 pages
3h 9m
English
Until now, you learned how to configure logs on a per-instance basis. We changed parameters in postgresql.conf globally, and we enjoyed the fact that logging was easy and fast.
However, in some cases, we might want to be a bit more fine grained and more specific about what has to be logged and what can go unnoticed.
PostgreSQL provides us with some instructions that allow us to set variables (work_mem, time_zone, logging related stuff, and so on) on a per-database basis. This can come in handy if you want to be a bit more selective. Here is how you can change logging for an entire database in your database instance:
test=# ALTER DATABASE test SET log_statement = 'all'; ALTER DATABASE
Of course, ...