Re: [HACKERS] Macros bundling RELKIND_* conditions - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [HACKERS] Macros bundling RELKIND_* conditions
Date
Msg-id 20170803204530.w4qouzb6bilqfbxe@alvherre.pgsql
Whole thread Raw
In response to Re: [HACKERS] Macros bundling RELKIND_* conditions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:

> I think Peter's got the error and the detail backwards.  It should be
> more like
> 
> ERROR: "someview" cannot have constraints
> DETAIL: "someview" is a view.
> 
> If we do it like that, we need one ERROR message per error reason,
> and one DETAIL per relkind, which should be manageable.

Hmm ... this works for me.  Hopefully we'd have the "foo is a view"
messages all centrally in pg_class.h (or maybe objectaddress, or some
other central place).  Then the "cannot have constraints" part would
appear directly in whatever .c file is doing the check; no need to
centralize in that case.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] elog vs errmsg_internal
Next
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] xmltable SQL conformance