Re: A Typo in regress/sql/privileges.sql

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Tatsuro Yamada <yamada(dot)tatsuro(at)lab(dot)ntt(dot)co(dot)jp>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A Typo in regress/sql/privileges.sql
Date: 2015-12-22 23:45:35
Message-ID: CAM3SWZSDYfktpt_biC0_4bRngD9FP=+328KQ+63PomNZycZcLA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 22, 2015 at 3:38 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> In my opinion a term more closely coupled to the concrete syntax would
> be easier to understand. I have no objection to referring to the
> *process* of trying to deduce a suitable index from the ON CONFLICT
> clause as "inference". But calling the ON CONFLICT clause an
> "inference specification" is, in my opinion, an unnecessary oblique
> way of referring to it. If you renamed InferenceElem to
> InsertOnConflictElem, I think that would be strictly more clear.

The documentation uses the term "unique index inference" to introduce
the concept. It then uses "inference" as a shorthand a couple of times
when the context is very well established. So I don't see that I've
done that at all.

As for the one user-visible error messages where the term "inference
specification" is used, that message also has a hint that draws
particular attention to what is meant:

if (onConflictClause->action == ONCONFLICT_UPDATE && !infer)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("ON CONFLICT DO UPDATE requires inference
specification or constraint name"),
errhint("For example, ON CONFLICT (column_name)."),
parser_errposition(pstate,
exprLocation((Node *) onConflictClause))));

(There is one appearance of "inference specification" in a defensive
elog() call).

So I still don't understand why anyone takes issue with this. It's a
total mystery to me.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2015-12-23 00:14:34 Re: [PROPOSAL] Backup and recovery of pg_statistic
Previous Message Robert Haas 2015-12-22 23:38:25 Re: A Typo in regress/sql/privileges.sql