From: | Michael Paquier <michael(at)paquier(dot)xyz> |
---|---|
To: | Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Unclear error message |
Date: | 2018-10-07 08:14:30 |
Message-ID: | 20181007081430.GD2710@paquier.xyz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sat, Oct 06, 2018 at 11:16:09PM +0200, Laurenz Albe wrote:
> True; how about the attached?
>
> I think this should go in before v11.
Thanks for adding regression tests for that.
- errmsg("foreign key referencing partitioned table \"%s\" must not be ONLY",
- RelationGetRelationName(pkrel))));
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.
--
Michael
From | Date | Subject | |
---|---|---|---|
Next Message | David Rowley | 2018-10-07 08:43:50 | Re: Calculate total_table_pages after set_base_rel_sizes() |
Previous Message | Michael Paquier | 2018-10-07 08:03:42 | Re: Defaulting to password_encryption = scram-sha-256 |