2

I’m using Rails4 with postgres as my database – because I’m using quite a lot of postgres–specific features, my schema is stored in .sql format (I’m not sure if it changes anything, but just in case…)

Currently, when I’m running tests, my console output is flooded with following logs:

SET
Time: 2.822 ms
CREATE EXTENSION
Time: 11.300 ms
(...)
COMMENT
CREATE TABLE
Time: 1.532 ms
(...)
INSERT 0 1
Time: 0.326 ms

I traced which task adds them, and they are created in db:structure:load task. Is there any way to suppress them?

I added min_messages: warning to my database.yml config, but unfortunately it didn’t change anything.

user1105595
  • 591
  • 2
  • 8
  • 20
  • Is `min_messages` set in the right environment? Have you tried a more restrictive setting? I think you can also use the `PGOPTIONS` environment variable in case `db:structure:load` is bypassing the driver and using `psql` directly. – mu is too short Dec 11 '13 at 19:31
  • Yep, I added this to all environments. I also tried to set ```PANIC``` level – without luck. I also checked, and this is probably because client_min_messages are set directly in structure.sql. I tried to set there ```SET client_min_messages = PANIC;``` as well, but without luck. – user1105595 Dec 11 '13 at 22:16

1 Answers1

1

Ok, I found it – the root of that cause was slightly different. Couple of days ago, I stumbled upon Thoughtbots’ post about improving postgres command–line experience – there is link to nice psqlrc settings, which I (after cosmetic modifications) applied on my machine. Apparently, the very last line (\unset QUIET) was causing this. After commenting out that, it works like a charm. Thank you all for your help!

user1105595
  • 591
  • 2
  • 8
  • 20