-
- Downloads
Remove the hack in the grammar that "optimized away" DEFAULT NULL clauses.
Instead put in a test to drop a NULL default at the last moment before storing the catalog entry. This changes the behavior in a couple of ways: * Specifying DEFAULT NULL when creating an inheritance child table will successfully suppress inheritance of any default expression from the parent's column, where formerly it failed to do so. * Specifying DEFAULT NULL for a column of a domain type will correctly override any default belonging to the domain; likewise for a sub-domain. The latter change happens because by the time the clause is checked, it won't be a simple null Const but a CoerceToDomain expression. Personally I think this should be back-patched, but there doesn't seem to be consensus for that on pgsql-hackers, so refraining.
Showing
- src/backend/catalog/heap.c 16 additions, 1 deletionsrc/backend/catalog/heap.c
- src/backend/commands/typecmds.c 62 additions, 26 deletionssrc/backend/commands/typecmds.c
- src/backend/parser/gram.y 3 additions, 35 deletionssrc/backend/parser/gram.y
- src/backend/parser/parse_expr.c 16 additions, 1 deletionsrc/backend/parser/parse_expr.c
- src/backend/parser/parse_utilcmd.c 1 addition, 2 deletionssrc/backend/parser/parse_utilcmd.c
- src/include/parser/gramparse.h 1 addition, 2 deletionssrc/include/parser/gramparse.h
- src/test/regress/expected/domain.out 9 additions, 1 deletionsrc/test/regress/expected/domain.out
- src/test/regress/sql/domain.sql 7 additions, 1 deletionsrc/test/regress/sql/domain.sql
Loading
Please register or sign in to comment