Hi hackers,
My colleague Chris Travers discovered something that looks like a bug.
Let's say we have a table with a constraint that is declared as NO INHERIT.
CREATE TABLE test (
x INT CHECK (x > 0) NO INHERIT
);
\d test
Table "public.test"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
x | integer | | |
Check constraints:
"test_x_check1" CHECK (x > 0) NO INHERIT
Now when we want to make a copy of the table structure into a new table
the `NO INHERIT` option is ignored.
CREATE TABLE test2 (LIKE test INCLUDING CONSTRAINTS);
\d test2
Table "public.test2"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
x | integer | | |
Check constraints:
"test_x_check1" CHECK (x > 0)
Is this a bug or expected behaviour? Just in case I've attached a patch
that fixes this.
Regards,
Ildar