mirror of
https://github.com/postgres/postgres.git
synced 2025-12-19 17:02:53 +03:00
pg_dump: include comments on valid not-null constraints, too
We were missing collecting comments for not-null constraints that are dumped inline with the table definition (i.e., valid ones), because they aren't represented by a separately dumpable object. Fix by creating separate TocEntries for the comments. Co-Authored-By: Jian He <jian.universality@gmail.com> Co-Authored-By: Álvaro Herrera <alvherre@kurilemu.de> Reported-By: Fujii Masao <masao.fujii@oss.nttdata.com> Reviewed-By: Fujii Masao <masao.fujii@oss.nttdata.com> Discussion: https://postgr.es/m/d50ff977-c728-4e9e-8488-fc2688e08754@oss.nttdata.com
This commit is contained in:
@@ -1659,6 +1659,8 @@ EXECUTE get_nnconstraint_info('{constr_parent3, constr_child3}');
|
||||
constr_parent3 | constr_parent3_a_not_null | t | t | 0
|
||||
(2 rows)
|
||||
|
||||
COMMENT ON CONSTRAINT constr_parent2_a_not_null ON constr_parent2 IS 'this constraint is invalid';
|
||||
COMMENT ON CONSTRAINT constr_parent2_a_not_null ON constr_child2 IS 'this constraint is valid';
|
||||
DEALLOCATE get_nnconstraint_info;
|
||||
-- end NOT NULL NOT VALID
|
||||
-- Comments
|
||||
|
||||
@@ -997,6 +997,9 @@ create table constr_parent3 (a int not null);
|
||||
create table constr_child3 () inherits (constr_parent2, constr_parent3);
|
||||
EXECUTE get_nnconstraint_info('{constr_parent3, constr_child3}');
|
||||
|
||||
COMMENT ON CONSTRAINT constr_parent2_a_not_null ON constr_parent2 IS 'this constraint is invalid';
|
||||
COMMENT ON CONSTRAINT constr_parent2_a_not_null ON constr_child2 IS 'this constraint is valid';
|
||||
|
||||
DEALLOCATE get_nnconstraint_info;
|
||||
|
||||
-- end NOT NULL NOT VALID
|
||||
|
||||
Reference in New Issue
Block a user