Re: Pg default's verbosity?

From: nik9000(at)gmail(dot)com
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Pg default's verbosity?
Date: 2012-06-17 04:00:20
Message-ID: D845F8AC-F09E-4EAF-9871-B5FE377DA583@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I've always used -1-f - < file.sql. It is confusing that -1 doesn't warn you when it wont work though.

Sent from my iPhone

On Jun 16, 2012, at 3:42 AM, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:

>
> Hello pgdev,
>
> (Second attempt)
>
> I've conducted a statistical study about PostgreSQL use in OSS. One of the result is that quite a few projects have errors in their SQL setup scripts which lead to some statements to be ignored, typically somme ADD CONSTRAINTS which do not change the database schema from a functional point of view, or syntactic errors (typically a mysql syntax...) that
> result in missing tables, but which are not found if the application is not fully tested.
>
> I think that there are two reasons why these errors are not caught by application developers:
>
> (1) the default verbosity is set to "notice", which is much to high. The users just get used to seeing a lot of messages on loading an sql script, and to ignore them, so that errors are just hidden in the flow of notices. I think that a better default setting would be "warnings", that is messages that require some attention from the developer.
>
> (2) the default behavior of psql on errors is to keep going. Developers of SQL script that are expected to work shoud be advised to:
> - encourage application devs to set ON_ERROR_STOP and/or use a global
> transaction in their script.
> - provide a simple/short option to do that from the command line
> basically that could be an enhanced "-1", NOT restricted
> to "-f" but that would work on standard input as well.
>
> sh> psql -1 -f setup.sql # -1 does work here
> sh> psql -1 < setup.sql # -1 does not apply to stdin stuff...
>
>
> So I would suggest the following todos:
>
> 1 - change the default verbosity to "warning".
>
> 2 - change -1 to work on stdin as well instead of being ignored,
> or provide another option that would do that.
>
> --
> Fabien Coelho - coelho(at)cri(dot)ensmp(dot)fr
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit kapila 2012-06-17 05:03:27 Re: Allow WAL information to recover corrupted pg_controldata
Previous Message Tom Lane 2012-06-17 03:57:31 Re: Broken system timekeeping breaks the stats collector