Re: NOTICE vs WARNING - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: NOTICE vs WARNING
Date
Msg-id Pine.LNX.4.44.0309022348570.1038-100000@peter.localdomain
Whole thread Raw
In response to Re: NOTICE vs WARNING  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: NOTICE vs WARNING
List pgsql-hackers
Tom Lane writes:

> I would say that NOTICEs are things that are routine in certain
> contexts.  We would not bother with the NOTICE at all if we thought
> it held no interest, but often it doesn't have any.
>
> Ignored syntax clauses probably ought to be WARNINGs, since the message
> is telling you that what you asked for isn't going to be done.  The
> other examples you give seem appropriate as NOTICEs.  In particular,
> the notices about changing "opaque" types to something else are a
> routine occurrence in upgrading old schemas, and so I think it's
> reasonable for them to be NOTICEs.

My gut feeling was that of all things the messages about changing the
opaque types should be warnings, because the effect of the command isn't
exactly what you entered.  A counterexample would be the notice about the
creation of a sequence for serial, because in that case the effect of the
command is exactly what you entered.

I don't think the "routine occurrence" criterion scales well, because if
you enter garbage, a syntax error is also a routine occurrence.

In fact, I like the criterion that a warning should be raised rather than
a notice if the effect of the command deviates from what the command
actually says.  That puts the messages for serials, primary keys, drop
cascades clearly into notices, messages about missing, implicitly added,
or changed syntax clauses into warnings.

I don't think the dump reload scenario is particularly important.  After
all, psql or pg_restore don't act differently upon notice or warning, it's
just something that the user reads.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Unixware Patch (Was: Re: Beta2 Tag'd and Bundled ...)
Next
From: "Marc G. Fournier"
Date:
Subject: Re: Win32 native port