Disabling NOTICE messages when using ruby-postgres

N

Nathaniel Talbott

Does anyone know if there's a way to disable the NOTICE messages when using
ruby-postgres? Example:

require 'dbi'
db = DBI::connect('dbi:pg:setest:localhost', 'setest', 'setest')
db.execute("CREATE TABLE test (id SERIAL PRIMARY KEY)")

=> NOTICE: CREATE TABLE will create implicit sequence 'test_id_seq' for
SERIAL column 'test.id'
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
'test_pkey' for table 'test'

I realize I'm using DBI, but it's Postgres that is at fault - evidently it
prints out some information straight to stderr.

Thanks,


Nathaniel

<:((><
 
T

ts

N> require 'dbi'
N> db = DBI::connect('dbi:pg:setest:localhost', 'setest', 'setest')

db.execute("set client_min_messages = warning")

N> db.execute("CREATE TABLE test (id SERIAL PRIMARY KEY)")



Guy Decoux
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,150
Latest member
MakersCBDReviews
Top