From 35e20606673ef37b263b2b8f701ed779c3a4b7e4 Mon Sep 17 00:00:00 2001 From: Jean-Michel Garnier Date: Wed, 26 Sep 2012 16:54:16 +0300 Subject: [PATCH 1/2] Use database.yml configuration tweak instead of postgres.conf --- README.textile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.textile b/README.textile index 2b6becc..afa85fb 100644 --- a/README.textile +++ b/README.textile @@ -226,10 +226,13 @@ DatabaseCleaner has an autodetect mechanism where if you do not explicitly defin h4. STDERR is being flooded when using Postgres If you are using Postgres and have foreign key constraints, the truncation strategy will cause a lot of extra noise to appear on STDERR (in -the form of "NOTICE truncate cascades" messages). To silence these warnings set the following log level in your postgresql.conf file: +the form of "NOTICE truncate cascades" messages). To silence these warnings set the following log level in your database.yml file:
-  client_min_messages = warning
+test:
+  adapter: postgresql
+  # ...
+  min_messages: WARNING  
 
From 9d40404c444618fb9e088a59cc15d8e5a94ba677 Mon Sep 17 00:00:00 2001 From: Jean-Michel Garnier Date: Tue, 29 Jan 2013 11:43:55 +0100 Subject: [PATCH 2/2] Update README.textile Use database.yml configuration tweak instead of postgres.conf when ActiveRecord ORM --- README.textile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.textile b/README.textile index afa85fb..602835f 100644 --- a/README.textile +++ b/README.textile @@ -226,7 +226,15 @@ DatabaseCleaner has an autodetect mechanism where if you do not explicitly defin h4. STDERR is being flooded when using Postgres If you are using Postgres and have foreign key constraints, the truncation strategy will cause a lot of extra noise to appear on STDERR (in -the form of "NOTICE truncate cascades" messages). To silence these warnings set the following log level in your database.yml file: +the form of "NOTICE truncate cascades" messages). + +To silence these warnings set the following log level in your postgresql.conf file: + +
+  client_min_messages = warning
+
+ +For ActiveRecord, you add the following parameter in your database.yml file:
 test:
@@ -235,7 +243,6 @@ test:
   min_messages: WARNING  
 
- h2. Debugging In rare cases DatabaseCleaner will encounter errors that it will log. By default it uses STDOUT set to the ERROR level but you can configure this to use whatever Logger you desire. Here's an example of using the Rails.logger in env.rb: