Default expressions for the copied column definitions will only be
copied if INCLUDING DEFAULTS is specified. The
- default behavior is to exclude default expressions, resulting in
- all columns of the new table having null defaults.
+ default behavior is to exclude default expressions, resulting in the
+ copied columns in the new table having null defaults.
- Likewise constraints for the copied column definitions will only be
- copied if INCLUDING CONSTRAINTS is specified. Note
- that currently even when INCLUDING CONSTRAINTS is specified
- only CHECK constraints are copied. Also, no distinction is made between
- column constraints and table constraints -- when constraints are
- requested all check constraints are copied.
+ Not-null constraints are always copied to the new table.
+ CHECK constraints will only be copied if
+ INCLUDING CONSTRAINTS is specified; other types of
+ constraints will never be copied. Also, no distinction is made between
+ column constraints and table constraints — when constraints are
+ requested, all check constraints are copied.
- Note also that unlike INHERITS<literal> copied columns and
+ Note also that unlike INHERITS</literal>, copied columns and
constraints are not merged with similarly named columns and constraints.
If the same name is specified explicitly or in another
LIKE clause an error is signalled.