Merge lp:~allenap/launchpad/log-statement-none into lp:launchpad

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~allenap/launchpad/log-statement-none
Merge into: lp:launchpad
Diff against target: 11 lines
1 file modified
utilities/launchpad-database-setup (+1/-1)
To merge this branch: bzr merge lp:~allenap/launchpad/log-statement-none
Reviewer Review Type Date Requested Status
Abel Deuring (community) Approve
Review via email: mp+13828@code.launchpad.net

Commit message

Disable PostgreSQL statement logging by default when setting up the database.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) wrote :

Default to not logging any statements when setting up the database. I
think it's basically harmful; it slows things down, takes up huge
amounts of disk space and is unnecessary 99% of the time. It's easy to
turn on again for a session, user or database, e.g.:

  SET log_statement TO 'all';
  ALTER ROLE launchpad SET log_statement TO 'all';
  ALTER DATABASE launchpad_dev SET log_statement TO 'all';

[ http://www.postgresql.org/docs/8.3/static/sql-set.html
  http://www.postgresql.org/docs/8.3/static/sql-alterrole.html
  http://www.postgresql.org/docs/8.3/static/sql-alterdatabase.html ]

It's also possible to trace statements using Storm:

  from storm.tracer import debug; debug(True)

[ https://dev.launchpad.net/Debugging ]

Revision history for this message
Abel Deuring (adeuring) wrote :

this look good, overall, so r=me, with one condition: From time to time it is useful to have all SQL statements logged. I think we have some script which directly use a the DB API module. So: could you add the "SET log_statement..." stuff to the debugging wiki page?

review: Approve
Revision history for this message
Gavin Panella (allenap) wrote :

Thanks Abel.

Wiki page - https://dev.launchpad.net/Debugging - updated. Good idea :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'utilities/launchpad-database-setup'
2--- utilities/launchpad-database-setup 2009-10-07 09:30:56 +0000
3+++ utilities/launchpad-database-setup 2009-10-23 10:05:23 +0000
4@@ -83,7 +83,7 @@
5 search_path='$user,public,ts2'
6 add_missing_from=false
7 #enable_seqscan=false
8-log_statement='all'
9+log_statement='none'
10 log_line_prefix='[%t] %q%u@%d '
11 fsync = off
12