Re: Unclear error message

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Unclear error message
Date: 2018-10-06 21:16:09
Message-ID: a388e4f351c2095eea05d572c68199faf2a3ddf8.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier wrote:
> On Thu, Sep 20, 2018 at 09:45:09PM +0200, Laurenz Albe wrote:
> > That message is wrong, because "rel" and not "pkrel" is the partitioned table.
> > I think it should be
> >
> > ereport(ERROR,
> > (errcode(ERRCODE_WRONG_OBJECT_TYPE),
> > errmsg("foreign key cannot be defined on ONLY \"%s\" for a partitioned table",
> > Relatio
> > nGetRelationName(rel))));
>
> Hmm... There are no test cases for this error message, nor for the one
> below "cannot add NOT VALID foreign key to relation foo", which is a bad
> idea.
>
> The referenced relation has to be RELKIND_RELATION. Here is another
> idea of error message:
> cannot use ONLY on partitioned table "foo" with foreign key

True; how about the attached?

I think this should go in before v11.

Yours,
Laurenz Albe

Attachment Content-Type Size
0001-Fix-an-error-message.patch text/x-patch 3.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2018-10-06 21:51:59 Re: Creating Certificates
Previous Message Tom Lane 2018-10-06 18:59:08 Re: executor relation handling