Re: several minor cleanups - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: several minor cleanups
Date
Msg-id 200206251822.g5PIMhh04752@candle.pha.pa.us
Whole thread Raw
In response to Re: several minor cleanups  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: several minor cleanups  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: several minor cleanups  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> >> While I don't object to renaming the routines internally, I do have
> >> strong doubts about changing the externally-visible error messages.
> >> I'd suggest undoing the particular changes that pass routine names
> >> to ExecConstraints, so that the error messages stay the same.  We
> >> can clean it up at some time *after* we offer error codes that clients
> >> can test.
>
> > Well, with no error codes on the horizon, and schemas appearing to break
> > lots of stuff, I don't see the need to keep error messages consistent.
>
> Schemas are NOT breaking clients that check to see which data-related
> condition caused an insert/update to fail.  I think it's important to
> recognize the distinction between query-related errors (eg you
> misspelled a column name) and data-related errors (the supplied value
> failed a constraint check), because I believe client logic is much more
> likely to contain pre-coded recovery behavior for specific types of
> data errors.
>
> Also, in places where we have changed error messages because of schemas,
> there is a good feature-related reason to do so.  This patch is adding
> zero benefit as far as users are concerned, so I think its cost/benefit
> ratio is too high to justify to users.
>
> > Heck, the error messages says:
> >    elog(WARNING, "ExecReplace: replace can't run without transaction");
> > and we haven't had replace since 1994 or so.
>
> Yeah, and why do you think it hasn't been changed?  Exactly this
> consideration.  I would probably have fixed those messages long ago
> if I hadn't been worried about breaking clients.

OK, does anyone know of any client that checks error message text in
this area?  There is that whole "prefix error message with function
name" problem that maybe we should address at this point and fix them
all.  I know Peter has mentioned this but I don't remember the context.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: several minor cleanups
Next
From: Tom Lane
Date:
Subject: Re: several minor cleanups