Configure psql to ignore notice messages

736 views
Skip to first unread message

Ivan Nunes

unread,
Aug 7, 2017, 6:06:16 PM8/7/17
to Sqitch Users
Hi,

Is it possible to ignore "NOTICE" messages through configuration in the sqitch.conf file?

Branch:develop Host:csabjsam Error:'psql.bin:deploy/criar_arquivo_imposto_taxa.sql:5: NOTICE:  table "imposto_taxa" does not exist, skipping'


Best regards.

David E. Wheeler

unread,
Aug 7, 2017, 6:12:08 PM8/7/17
to Ivan Nunes, Sqitch Users
Yep. I put this at the top of most of my Sqitch scripts:

    SET client_min_messages TO WARNING;

You can also set it in the postgresql.conf or via ALTER DATABASE.


HTH,

David


signature.asc

Nikolay Samokhvalov

unread,
Aug 7, 2017, 8:28:05 PM8/7/17
to David E. Wheeler, Ivan Nunes, Sqitch Users
On Mon, Aug 7, 2017 at 3:12 PM, David E. Wheeler <da...@justatheory.com> wrote:

You can also set it in the postgresql.conf or via ALTER DATABASE.
 
...or via ALTER ROLE -- in some cases this way might be more convenient to control such things.


Ivan Nunes

unread,
Aug 8, 2017, 7:33:39 AM8/8/17
to Sqitch Users, ivanels...@gmail.com
So, using postgres own resources, I already knew.

I did not want to put this inside every script (deploy, revert, verify). My colobarores are kind of forgotten.

I also did not want to insert in my ".psqlrc", I have more than 300 db's.

I simply wanted to place in repo/sqitch.conf and so sqitch + ansible would already do the rest.

Tky

David E. Wheeler

unread,
Aug 8, 2017, 9:41:07 AM8/8/17
to Ivan Nunes, Sqitch Users
On Aug 8, 2017, at 7:33 AM, Ivan Nunes <ivanels...@gmail.com> wrote:

> So, using postgres own resources, I already knew.
>
> I did not want to put this inside every script (deploy, revert, verify). My colobarores are kind of forgotten.
>
> I also did not want to insert in my ".psqlrc", I have more than 300 db's.
>
> I simply wanted to place in repo/sqitch.conf and so sqitch + ansible would already do the rest.

No, there is currently no way to do this directly in Sqitch; it mostly tries to avoid database-specific interface stuff. The best way to do it is to put it in the scripts that need it.

Best,

David

signature.asc
Reply all
Reply to author
Forward
0 new messages