addColumn should support not-null constraint with an initial default value

Description

When adding a new not-null column to an existing table I need to do this in two separate steps. First creating the column with a predefined value and after that I can add the not-null constraint.

For my understanding it would be more readable when I could write:

Would be nice if there could be an easier command for doing this if its not to much effort or violates some rules.

Environment

Linux 2.6.32-31-generic, PostgreSQL

Activity

Show:

cen1 cen1 September 21, 2020 at 10:38 AM
Edited

This has a Fix Verison of 4.0.0 but is still Open. I assume it means this was left out of 4.0.0?

 

edit: nevermind, I just now realized github is now the source and pull is waiting for merge.

Nathan Voxland July 28, 2015 at 3:23 PM

I'll look at checking the default value and not null attributes to output a separate addNotNullConstraint with 4.0. For now, you'll just have to do it in separate steps.

Nathan Voxland July 14, 2015 at 2:41 PM

Order of DEFAULT VALUE and NOT NULL was incorrect in 3.4.0

Reporter

Components

Fix versions

Affects versions

Priority

Created April 26, 2011 at 7:29 AM
Updated September 21, 2020 at 10:40 AM