From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
Cc: | Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Joe Conway <mail(at)joeconway(dot)com> |
Subject: | Re: Macros bundling RELKIND_* conditions |
Date: | 2017-08-02 18:07:59 |
Message-ID: | 15967.1501697279@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> Peter Eisentraut wrote:
>> The actual error, from the perspective of the user, is something like
>> ERROR: "someview" is a view
>> DETAIL: Views cannot have constraints.
> OK. "%s is a %s" is a reasonable set of errors -- we just need one for
> each relkind. So the first one is easy.
> But the second one is not easy, because we'd need one message per
> relkind per operation kind. We cannot possibly write/translate that
> many messages. If we make the relkind generic in the errdetail message,
> maybe it can work; something like "Relations of that type cannot have
> constraints" would work, for example. Or "Relations of type "view"
> cannot have constraints", although this reads very strangely. Maybe
> someone has a better idea?
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.
A more verbose approach is
ERROR: "someview" cannot have constraints
DETAIL: "someview" is a view, which is not a supported kind of relation
for this purpose.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2017-08-02 18:17:13 | Re: reload-through-the-top-parent switch the partition table |
Previous Message | Stephen Frost | 2017-08-02 17:58:38 | Re: pg_stop_backup(wait_for_archive := true) on standby server |