Обсуждение: pgsql: Improve consistency of error reporting in GUC assign_hook

Поиск
Список
Период
Сортировка

pgsql: Improve consistency of error reporting in GUC assign_hook

От
tgl@postgresql.org (Tom Lane)
Дата:
Log Message:
-----------
Improve consistency of error reporting in GUC assign_hook routines.  Some
were reporting ERROR for interactive assignments and LOG for other cases,
some were saying nothing for non-interactive cases, and a few did yet other
things.  Make them use a new function GUC_complaint_elevel() to establish
a reasonably uniform policy about how to report.  There are still a few
edge cases such as assign_search_path(), but it's much better than before.
Per gripe from Devrim Gunduz and subsequent discussion.

As noted by Alvaro, it'd be better to fold these custom messages into the
standard "invalid parameter value" complaint from guc.c, perhaps as the DETAIL
field.  However that will require more redesign than seems prudent for 8.3.
This is a relatively safe, low-impact change that we can afford to risk now.

Modified Files:
--------------
    pgsql/src/backend/commands:
        tablespace.c (r1.51 -> r1.52)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/tablespace.c?r1=1.51&r2=1.52)
        variable.c (r1.122 -> r1.123)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/variable.c?r1=1.122&r2=1.123)
    pgsql/src/backend/tcop:
        postgres.c (r1.539 -> r1.540)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/postgres.c?r1=1.539&r2=1.540)
    pgsql/src/backend/utils/misc:
        README (r1.7 -> r1.8)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/README?r1=1.7&r2=1.8)
        guc.c (r1.427 -> r1.428)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/guc.c?r1=1.427&r2=1.428)
    pgsql/src/include/utils:
        guc.h (r1.88 -> r1.89)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/guc.h?r1=1.88&r2=1.89)