BUG #16730: Create table like with inheritance and self referencing index
The Post Office <noreply@postgresql.org>
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: sofoklis24@gmail.com
Date: 2020-11-19T15:41:24Z
Lists: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 16730
Logged by: Sofoklis Papasofokli
Email address: sofoklis24@gmail.com
PostgreSQL version: 10.15
Operating system: PostgreSQL 10.15 (Ubuntu 10.15-1.pgdg20.04+1) on
Description:
The following simplified example used to work on previous versions, but not
on 10.15, we tested it again on version 10.11 and it works.
We read in the release notes of 10.15 that there is a change when using like
with inheritance, maybe it is related.
CREATE TABLE id_base
(
id SERIAL PRIMARY KEY
);
CREATE TABLE inherited_table
(
LIKE id_base INCLUDING DEFAULTS INCLUDING CONSTRAINTS INCLUDING
INDEXES,
"self_ref_if" INT,
CONSTRAINT self_ref_id_fk FOREIGN KEY ("self_ref_if")
REFERENCES inherited_table (id) MATCH SIMPLE
ON UPDATE RESTRICT ON DELETE RESTRICT
)
INHERITS (id_base);
Commits
-
Further fixes for CREATE TABLE LIKE: cope with self-referential FKs.
- c690ebbefa33 11.11 landed
- 98f3f1d5c1bf 13.2 landed
- 97390fe8a6e9 14.0 landed
- 87ab46421925 12.6 landed
- 6631d5f261e9 9.5.25 landed
- 513db7b7004c 10.16 landed
- 159b6775fad9 9.6.21 landed