Hi,
It was reported in [1] that creating a partitioned table by using
'CREATE TABLE .. (LIKE ...)' can lead to a not null constraint with
'NO INHERIT' being copied. This is disallowed for partitioned tables
but the LIKE option has accidentally allowed it.
This seems like an unlikely scenario in practice but since it is
simple to fix, I think we should handle it.
I'm attaching a patch which fixes this by explicitly checking for a
not-null NO INHERIT constraint in transformTableLikeClause and
throwing an error.
Please take a look and let me know what you think.
[1] https://www.postgresql.org/message-id/flat/19770-7c6e75fc30df7e06%40postgresql.org
Thanks & Regards,
Nitin Motiani
Google