Re: Unclear error message - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Unclear error message
Date
Msg-id 20181007093744.GE2710@paquier.xyz
Whole thread Raw
In response to Re: Unclear error message  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Unclear error message  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-hackers
On Sun, Oct 07, 2018 at 05:14:30PM +0900, Michael Paquier wrote:
> Here is a counter-proposal:
> "cannot use ONLY for foreign key on partitioned table \"%s\" referencing
> relation \"%s\""
>
> +-- also, adding a NOT VALID foreign key should fail
> +ALTER TABLE fk_partitioned_fk ADD FOREIGN KEY (a, b) REFERENCES fk_notpartitioned_pk NOT VALID;
> +ERROR:  cannot add NOT VALID foreign key to relation "fk_notpartitioned_pk"
> +DETAIL:  This feature is not yet supported on partitioned tables.
>
> This error should mention "fk_partitioned_fk", and not
> "fk_notpartitioned_pk", no?  The foreign key is added to the former, not
> the latter.

And after some more study, I finish with the attached.  Thoughts?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Calculate total_table_pages after set_base_rel_sizes()
Next
From: Andrew Gierth
Date:
Subject: Re: Performance improvements for src/port/snprintf.c