Skip to Content
PostgreSQL Administration Essentials
book

PostgreSQL Administration Essentials

by Hans-Jürgen Schönig
October 2014
Intermediate to advanced content levelIntermediate to advanced
142 pages
3h 9m
English
Packt Publishing
Content preview from PostgreSQL Administration Essentials

Making log creation more fine grained

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.

Logging selectively

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, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PostgreSQL 9 Administration Cookbook - Second Edition

PostgreSQL 9 Administration Cookbook - Second Edition

Simon Riggs, GIANNI CIOLLI, Hannu Krosing, Gabriele Bartolini

Publisher Resources

ISBN: 9781783988983