Improve consistency of error reporting in GUC assign_hook routines. Some
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 28 Dec 2007 00:23:23 +0000 (00:23 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 28 Dec 2007 00:23:23 +0000 (00:23 +0000)
commit9ef704e70470586fd34f3c33b4e07ea558754ba2
tree1b160a7948d6c4be6f39320a75f4500d9d4fbf80
parentb076a9fe29fb9d690a875d217de199b7fe30ec2e
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.
src/backend/commands/tablespace.c
src/backend/commands/variable.c
src/backend/tcop/postgres.c
src/backend/utils/misc/README
src/backend/utils/misc/guc.c
src/include/utils/guc.h